Norman, First, you will likely run into problems if you store every cart in the same object as the store, for example, if multiple people try to update their carts at the same time. I would store each cart individually, and link them back to the store or keep them in a bucket named for the store, i.e. carts_[store_key]/[cart_key].
As far as the algorithm for upselling, that sounds like the job of a graph database, which would make it easy to do traversals between purchased items, categories, etc between multiple stores. Sean Cribbs <s...@basho.com> Developer Advocate Basho Technologies, Inc. http://basho.com/ On Aug 30, 2010, at 6:03 AM, Norman Khine wrote: > hello, > i am designing a schema to store shopping cart data and checkout > confirmation for a multi shop environment, here is what i have now and > am hoping for advise if there could be more efficient ways to do this. > > the point of the exercise is to be able to study the purchasing habits > of shoppers and also cross sell based on the following question: > > "what other products does a cart have that may be of interest at the > next checkout across the whole set of stores" > > i am thinking to store each shop and then within it store the carts > for that specific shop. > > http://pastie.org/1126289 > > store = {"name": "Bébebox", > "url_hash":"bébebox", > "store-type": ["childres's clothes", "children's toys"....], > "carts":[ > {"cart-id": "X12345", > "date":30/08/2010, > "total":26.00, > "tax": 12, > "status":"pending", > "products": [ > { "name":"Nice baby dress", > "url_hash":"cool-street-kid", > "price": 4.00, > "currency": "EURO", > "size":23, > "description":"This is the desc." > }, > .... > } > } > > would this be an efficient way to store the objects in riak for > example if i want to retrieve all the products with a price range of > up to 4.00 EURO and stores that have category "childres's clothes" and > size is 23? > > > any suggestions would be much appreciated. > > thanks > > norman > > > -- > ˙uʍop ǝpısdn p,uɹnʇ pןɹoʍ ǝɥʇ ǝǝs noʎ 'ʇuǝɯɐן sǝɯıʇ ǝɥʇ puɐ 'ʇuǝʇuoɔ > ǝq s,ʇǝן ʇǝʎ > %>>> "".join( [ {'*':'@','^':'.'}.get(c,None) or > chr(97+(ord(c)-83)%26) for c in ",adym,*)&uzq^zqf" ] ) > > _______________________________________________ > riak-users mailing list > riak-users@lists.basho.com > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com _______________________________________________ riak-users mailing list riak-users@lists.basho.com http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com