Couchbase
  • Why NoSQL?
  • Couchbase Server
  • Download
  • Resources
  • Careers
Home | Forums | Couchbase | Couchbase Server 2.0

Memcached-Challenge

1 reply [Last post]
  • Login or register to post comments
Sun, 02/10/2013 - 21:52
sullivan5000
Offline
Joined: 02/05/2013
Groups: None

Hi everybody

I'm wondering what you would do and come up with a little challenge: I develop a webapp using Grails, Couchbase (Memcached Bucket) and Mysql as persistence. Now, I have following domain classes (simplified):

Product: Can be in one category
Category: Can have nested children, and have multiple products.

I need to access all product objects by id which led me to the idea to store all products in one big Memcached-entry with a key: PRODUCTMAP and as value, all product attributes as array, like: [productId1: [title: 'title'], productId2: [title: 'title']]

If I browse to category 4, I simply get my map categoryMap with value [cateoryId: [productId1, productId2]]
I also can list all products of a certain category by providing that id.

The bad thing about this is that I always have to put back everything (ie the whole productMap) if I modify a single product.

Who can give advice how to realize that?
Any help will be appreciated!

Thanks,

Best
Sullivan

Top
  • Login or register to post comments
Tue, 02/12/2013 - 06:47
tgrall
Offline
Joined: 09/05/2012
Groups: None

Hello,

Have you tried to use another approach where your store in memory each product separately ( one entry for each product) and keep only if necessary the list of product in the category?

Is that possible?
You can for example prefix the product ID by the category if the product id is not unique.

Also if you start to change the model, have you looked at moving the data from MySQL+Couchbase Memcache to a 100% Couchbase (with Couchbase Bucket)?

Regards

__________________

Tug
@tgrall

Top
  • Login or register to post comments
  • Login or register to post comments
  • Login
  • Register

Company

  • About Us
  • Leadership
  • Customers
  • Partners
  • Contact Us

Product

  • Couchbase Server
  • Couchbase SDKs
  • Use Cases
  • Documentation
  • Forums

Open Source

  • Couchbase Project
  • Couchbase vs. CouchDB

Commercial

  • Subscriptions & Support
  • Training & Services

News

  • Blog
  • Newsletter
  • Press Releases
  • Buzz

Follow Us

    
  • Customer Login
  • Terms of Service
  • Privacy Policy
  • Trademark Policy
  • Site Map

© 2013 COUCHBASE All rights reserved.

Sign in to Couchbase Community

close
  • Create new account
  • Request new password
You are logging into the Forums, Wiki and Issue Tracker