<div dir="ltr">Li Ma,<div><br></div><div>This is interesting, In general I am in favor of expanding the scope of any read/write separation capabilities that we have. I'm not clear what exactly you are proposing, hopefully you can answer some of my questions inline. The thing I had thought of immediately was detection of whether an operation is read or write and integrating that into oslo.db or sqlalchemy. Mike Bayer has some thoughts on that[1] and there are other approaches around that can be copied/learned from. These sorts of things are clear to me and while moving towards more transparency for the developer, still require context. Please, share with us more details on your proposal.</div>
<div><br></div><div>-Mike</div><div><br></div><div>[1] <a href="http://www.percona.com/doc/percona-xtradb-cluster/5.5/wsrep-system-index.html">http://www.percona.com/doc/percona-xtradb-cluster/5.5/wsrep-system-index.html</a></div>
<div>[2] <a href="http://techspot.zzzeek.org/2012/01/11/django-style-database-routers-in-sqlalchemy/">http://techspot.zzzeek.org/2012/01/11/django-style-database-routers-in-sqlalchemy/</a></div>

<div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Aug 7, 2014 at 10:03 PM, Li Ma <span dir="ltr"><<a href="mailto:skywalker.nick@gmail.com" target="_blank">skywalker.nick@gmail.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Getting a massive amount of information from data storage to be displayed is<br>



where most of the activity happens in OpenStack. The two activities of reading<br>
data and writing (creating, updating and deleting) data are fundamentally<br>
different.<br>
<br>
The optimization for these two opposite database activities can be done by<br>
physically separating the databases that service these two different<br>
activities. All the writes go to database servers, which then replicates the<br>
written data to the database server(s) dedicated to servicing the reads.</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">



<br>
Currently, AFAIK, many OpenStack deployment in production try to take<br>
advantage of MySQL (includes Percona or MariaDB) multi-master Galera cluster.<br>
It is possible to design and implement a read/write separation schema<br>
for such a DB cluster.<br></blockquote><div><br></div><div>I just want to clarify here, are you suggesting that _all_ reads and _all_ writes would hit different databases? It would be interesting to see a relational schema design that would allow that to work. That seems like something that you wouldn't try in a relational database at all.<br>


</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
Actually, OpenStack has a method for read scalability via defining<br>
master_connection and slave_connection in configuration, but this method<br>
lacks of flexibility due to deciding master or slave in the logical<br>
context(code). It's not transparent for application developer.<br>
As a result, it is not widely used in all the OpenStack projects.<br>
<br>
So, I'd like to propose a transparent read/write separation method<br>
for oslo.db that every project may happily takes advantage of it<br>
without any code modification.<br></blockquote><div><br></div><div>The problem with making it transparent to the developer is that, well, you can't unless your application is tolerant of old data in an asynchronous replication world. If you are in a fully synchronous world you could fully separate writes and reads, but what would be the point since your database performance is now trash anyway. Please note that although Galera is a considered a synchronous model it's not actually all the way there. You can break the certification of course, but there are also things that are done to keep the performance to an acceptable level. Take for example the wswrep_causal_reads configuration parameter[2]. Without this sucker being turned on you can't make read/write separation transparent to the developer. Turning it on causes a significant performance degradation unfortunately. </div>

<div><br></div><div>I feel like this is a problem fundamental to a consistent relational dataset. If you are okay with eventual consistency it's okay, you can make things transparent to the developer. But by it's very nature relational datasets are well, relational, they need all the other pieces and those pieces need to be consistent. I guess what I am saying is that your proposal needs more details. Please respond with specifics and examples to move the discussion forward.</div>


<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
Moreover, I'd like to put it in the mailing list in advance to<br>
make sure it is acceptable for oslo.db.<br>
<br>
I'd appreciate any comments.<br>
<br>
br.<br>
Li Ma<br>
<br>
<br>
_______________________________________________<br>
OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org" target="_blank">OpenStack-dev@lists.openstack.org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
</blockquote></div><br></div></div>