user2470997
user2470997

Reputation: 11

CouchBase Server use-case: grid with fresh data impossible?

we're facing a common use-case which seems "impossible" to solve with CouchBase server.... Basically in our web app we need to implement grids showing FRESH data (with all newest/updated documents present!)

EX: User creates a new "order" in a dedicated edit page, then goes to "all orders" page with the grid and expects to see the just-created record.

How can we achieve this?

Any soulution? For this kind of needs is a NoSql DB a good way out? (We'd like to avoid mixed-solution RDBMS+NoSql... Maybe a compromise on grids freshness or a complicated "home-made dirty-documents-list" mechanism?)

Thankyou in advance....

Upvotes: 1

Views: 140

Answers (1)

scalabilitysolved
scalabilitysolved

Reputation: 2474

Firstly it'd be good if you could give more information so we could look at why your disk writes are so low. Secondly have you decided to use Couchbase because you want to or because it fits your data and access patterns? Wouldn't a RDBMS solution be better for you?

Regarding your explanation of a user creating a new order, personally I wouldn't use a view to capture this data, on the user document I would have two attributes, processed orders and pending orders. As a user adds something to their basket you could add the id of the product to the pending orders array, as the transaction is completed this could then be moved to processed orders.

This structure means that when you want to display all orders for a user you can just do a simple multi get on all the ids held on the document, be aware that you'd then have to sort them at the application layer by whichever attribute you wanted but that'd be trivial!

Good luck!

Upvotes: 1

Related Questions