Schema Evolution

Hi Guys,

Does Cockroach supports Schema Evolution, like we can put new column in new column family with the same rowkey in HBase or we have complex data types map, list, set in cassandra.
I can only find array in document section.
I am digging more but if anybody can help me would be great.


Dear Ankit,

it is possible to create new column families on an existing table. You can also create interleaved tables to separate data logically but have it share locality in storage.

CockroachDB v1.1 only supports arrays to store multiple items of data in a single column. CockroachDB v2.0 will add support for JSON. We might implement additional record types (or even user-defined types) in the future depending on user demand.

Does this clarify? Is there anything else we can help you with?

Dear @knz
To add new column families do we need to do “alter” or is there any api like hbase put.
Let me explain more with example:- I have click-stream data and page wise I want to store that into db, t_page_info(cf1:col1,cf1:col2…), next time I wanna put cf1:col3 or cf2:col1.
As we know in RDBMS what I’ll have to do alter the table and then ingest the data but in nosql like hbase we just ingest the data (no need to alter).
So is this supported by Cockroach because I couldn’t find any api/statement in document section, may be I missed it.
I will appreciate if you guide me or redirect me to relevant links.


Dear Ankit

thanks for your follow-up question. Can you provide some example data that you would like to insert into your table? I am not sure I fully understand the question.
Thank you in advance

Thanks @knz and sorry for late reply, please check below example
hbase> create ‘Tab1’, ‘CLICK_DATA’ (column family: CLICK_DATA)
hbase> put ‘Tab1’,‘1’,‘CLICK_DATA:NAME’,‘ABC’ (column: NAME)
hbase> put ‘Tab1’,‘1’,‘CLICK_DATA:LINK’,‘’
… and so on but as I shared its click-stream data so in columns we can have many column and its pure dynamic.
If I have pre-decided column then its pretty much simple to put in a table in CockroachDB, but above is the case and I could not find any API whose similar to this.

Thanks in Advance :slight_smile:

And what about using a table with a JSON column and using various/dynamic JSON fields inside that column? You can try out JSON with CockroachDB v2.0-alpha already.

You are talking about column with JSON data type or varchar column with JSON data? That we can do but we’ll have same problem like other RDBMS parsing and getting data will be bulky and if I want to put new data with the same key it’ll go for update and again process overhead.
So there is no other thing we can do in Cockroach.

I am talking about a column with JSON data type.