[openstack-dev] [oslo.db]A proposal for DB read/write separation

Mike Bayer mbayer at redhat.com
Fri Aug 8 13:21:15 UTC 2014


On Aug 8, 2014, at 12:03 AM, Li Ma <skywalker.nick at gmail.com> wrote:

> 
> So, I'd like to propose a transparent read/write separation method 
> for oslo.db that every project may happily takes advantage of it 
> without any code modification.


A single transaction begins, which is to emit a series of INSERT, UPDATE, and SELECT statements.   Are you proposing that this system in fact produce two separate transactions on two separate backends, and deliver the SELECT statements to the slave?   That approach isn’t feasible - SELECTs are part of a “write” transaction just as much as the other statements are (as they can be SELECTing locally uncommitted data), as they deliver data which is part of the transactional context as well as intended for those DML statements.   Otherwise, by what system could this read/write be “transparent”?    reader/writer has to be at the transaction level, not the statement level, and without an up-front declaration as to whether a transaction is to be reader or writer, it’s not possible.





More information about the OpenStack-dev mailing list