Re: Pattern to store maps of maps...

2014-06-14 Thread Kevin Burton
Wow.. that's the right answer. Now I'm super excited for C* 2.1 :) .. yeah.. that would work perfectly. having custom types would perfectly solve my problem. Now the issue is whether I wait for the next version or just push through this version… On Sat, Jun 14, 2014 at 2:24 AM, DuyHai Doan w

Re: Pattern to store maps of maps...

2014-06-14 Thread DuyHai Doan
Every thing is possible with Thrift, provided that you manage every thing manually client side. Having coded an implementation of Achilles (object mapper) over Hector, it was really painfull to manage collections in Thrift. Now to stick to the topic, if you want to nest collections into collecti

Re: Pattern to store maps of maps...

2014-06-13 Thread Johan Edstrom
Well to throw fire on the debate, that was actually really simple in Thrift. On Jun 13, 2014, at 10:50 PM, Kevin Burton wrote: > I could see just saying screw it and storing a serialized json object that > gets read back in automatically as a map. That wouldn't be too painful but > just not s

Re: Pattern to store maps of maps...

2014-06-13 Thread Kevin Burton
I could see just saying screw it and storing a serialized json object that gets read back in automatically as a map. That wouldn't be too painful but just not super pretty in terms of representing the data in cassandra. On Fri, Jun 13, 2014 at 8:45 PM, Jack Krupansky wrote: > The first quest

Re: Pattern to store maps of maps...

2014-06-13 Thread Kevin Burton
On Fri, Jun 13, 2014 at 7:26 PM, Johan Edstrom wrote: > We treat this on an Object level in Java as a new table with separate > Hydration. > On a Map level we currently utilize an Internal CQL3 map where we replace > the non scalar values with > separate tables - we just stick the ID in. > Same f

Re: Pattern to store maps of maps...

2014-06-13 Thread Jack Krupansky
The first question is how you need to access this data. Do you need to directly access “bar” from a SELECT? Do you need to access “foo” as... what – Java Map, or what? That said, you can always flatten a map of maps by simply concatenating the keys, such as {“foo_bar”: “hello”} and then you can

Re: Pattern to store maps of maps...

2014-06-13 Thread Johan Edstrom
We treat this on an Object level in Java as a new table with separate Hydration. On a Map level we currently utilize an Internal CQL3 map where we replace the non scalar values with separate tables - we just stick the ID in. Same for Sets, Arrays and such. You get more writes but you also have

Re: Pattern to store maps of maps...

2014-06-13 Thread graham sanderson
My personal opinion is that unless you are doing map operations on a CQL3 map and will always intend to read the whole thing (you don’t have any choice today), don’t use one at all - use a blob of whatever variety makes sense (e.g. Json, AVRO, Protobuf etc) On Jun 13, 2014, at 7:17 PM, Kevin Bu