Bringing together the Apache Cassandra experts from the community and DataStax.

Want to learn? Have a question? Want to share your expertise? You are in the right place!

Not sure where to begin? Getting Started

 

question

tyuen_144153 avatar image
tyuen_144153 asked ·

What are the pros and cons of storing data serialized into one column vs individual columns?

Let say I have a customer column family.

The columns: firstname, lastname, username, etc. . . . shipToStreet, shipToCity, shipToState, shipToEmail

Want to ask the pro & cons to store "shipTo" info as serialized JSON into a column as Map<text, text> vs. stored each field separately

data modeling
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered ·

It's not a problem either way from a Cassandra perspective. It all depends on your use case and requirements.

If you store the shipping address into a single column, it just means that you won't be able to retrieve/update individual components of the address. Cheers!

Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.