I want to store python dict
objects (same structure) in Cassandra. I only want to store them in one column. I can create a Cassandra column:
- as
MAP
- as
TEXT
. I can then serialize dict into json string and store it.
But not all the items in my python dict
map to the same type, for example
dict = {"key_1": "abc", "key_2": 10, "key_3": True}
In this case, I think only Option 2 is valid? In my actual project, I have many columns to create. Some map to the same type and some don't. For convience, I want to just serialize all of them and store as TEXT
. But this feels a bit unorthodox to me. What's the best practice?