transactions - how do non-ACID RethinkDB or MongoDB maintain secondary indexes for non-equal queries -


this more of 'inner workings' undestanding question:

how nosql databases not support *a*cid (meaning cannot update/insert , rollback data more 1 object in single transaction) -- update secondary indexes ?

my understanding -- in order keep secondary index in sync (other wise become stale reads) -- has happen withing same transaction.

furthermore, if possible index reside on different host data -- distributed lock needs present and/or two-phase commit such update work atomically.

but if these databases not support multi-object transactions (which means not two-phase commit on data across multiple host) , method use guarantee secondary indices reside in b-trees structures separate data not stale ?

this great question.

rethinkdb stores secondary indexes on same host primary index/data table. in case of joins, rethinkdb brings query data, secondary indexes, primary indexes, , data reside on same node. result, there no need distributed locking protocols such 2 phase commit.

rethinkdb support limited set of transactional functionality -- single document transactions. changes single document recorded atomically. relevant secondary index changes recorded part of transaction, either entire change recorded, or nothing recorded @ all.

it easy extend limited transactional functionality support multiple documents in single shard, hard across shards (for distributed locking reasons brought up), decided not implement transactions multiple documents yet.

hope helps.


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -