unique id generation
Tue, 07/27/2010 - 13:49
hi
in porting a traditional rdbms based application to membase involves a number of challenges, one of the tasks that rdbms typically can do is to generate unique ids. this remains revelant in a heterogenous environment. one solution i can think of is using a "memcached" counter (incr/decr) to provide this functionality, i'm wondering in the context of HA membase, is this a good solution?
to extrapolate, the real underlying question i suppose is: if an atomic operation is completed on the host machine, is it guaranteed to be available on a replica in case failover happens?
appreciate any input/advice/comments.
thanks!
peter
There is a plan to provide synchronous replication and persistence, and membase is architected for that. In the current beta release, however, the atomic incr/decr are not guaranteed to be replicated in the case of a failure.
In the future, you could define this 'sequence generator' in a separate bucket whose replication is synchronous to ensure it's always replicated.
- Matt