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

Mike Bayer mbayer at redhat.com
Sun Aug 10 14:56:58 UTC 2014


On Aug 10, 2014, at 9:59 AM, Amrith Kumar <amrith at tesora.com> wrote:

>  
> To Mike Bayer’s point about data distribution and transaction management; yes, we handle all the details relating to handling data consistency and providing atomic transactions during Insert/Update/Delete operations.
>  
> As a company, we at Tesora are committed to OpenStack and are significant participants in Trove (the database-as-a-service project for OpenStack). You can verify this yourself on Stackalytics [7] or [8]. If you would like to consider it as a part of your solution to oslo.db, we’d be thrilled to work with the OpenStack community to make this work, both from a technical and a business/licensing perspective. You can catch most of our dev team on either #openstack-trove or #tesora.
>  
> Some of us from Tesora, Percona and Mirantis are planning an ops panel similar to the one at Atlanta, for the Summit in Paris. I would definitely like to meet with more of you in Paris and discuss how we address issues of scale in the database that powers an OpenStack implementation.


OK well just to be clear, oslo.db is Python code that basically provides in-application helpers and patterns to work with databases, primarily through SQLAlchemy.   So it’s essentially openstack-specific patterns and recipes on top of SQLAlchemy.     It has very little to do with the use of special database backends that know how to partition among shards and/or master/slaves (I thought the original proposal was for master/slave).    So the Tesora product would be 99% “drop in”, with at most some configurational flags set up on the Python side, and everything else being configurational. Since the proposal here is for “transparent”, which is taken to mean, “no app changes are needed”.   My only point was that, an application-layer reader/writer distribution approach would need to work at the level of transactions, not statements, and therefore would need to know at transaction start time what the nature of the transaction would be (and thus requires some small declaration at the top, hence code changes…code changes that I think are a good thing as explicit declaration of reader/writer methods up top can be handy in other ways too).


>  
> Thanks,
>  
> -amrith
>  
> --
>  
> Amrith Kumar, CTO Tesora (www.tesora.com)
>  
> Twitter: @amrithkumar 
> IRC: amrith @freenode
>  
>  
> [1] http://www.tesora.com/solutions/database-virtualization-engine
> [2] http://www.tesora.com/solutions/downloads/products
> [3] http://www.mysqlperformanceblog.com/2014/06/24/benchmarking-tesoras-database-virtualisation-engine-sysbench/
> [4] http://www.tesora.com/blog/perconas-evaluation-our-database-virtualization-engine
> [5] http://resources.tesora.com/site/download/percona-benchmark-whitepaper
> [6] http://www.tesora.com/blog/ingesting-over-1000000-rows-second-mysql-aws-cloud
> [7] http://stackalytics.com/?module=trove-group&metric=commits
> [8] http://stackalytics.com/?module=trove-group&metric=marks
>  
>  
>  
>  
>  
> From: Mike Wilson [mailto:geekinutah at gmail.com] 
> Sent: Friday, August 08, 2014 7:35 PM
> To: OpenStack Development Mailing List (not for usage questions)
> Subject: Re: [openstack-dev] [oslo.db]A proposal for DB read/write separation
>  
> Li Ma,
>  
> 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.
>  
> -Mike
>  
> [1] http://www.percona.com/doc/percona-xtradb-cluster/5.5/wsrep-system-index.html
> [2] http://techspot.zzzeek.org/2012/01/11/django-style-database-routers-in-sqlalchemy/
>  
> 
> On Thu, Aug 7, 2014 at 10:03 PM, Li Ma <skywalker.nick at gmail.com> wrote:
> Getting a massive amount of information from data storage to be displayed is
> where most of the activity happens in OpenStack. The two activities of reading
> data and writing (creating, updating and deleting) data are fundamentally
> different.
> 
> The optimization for these two opposite database activities can be done by
> physically separating the databases that service these two different
> activities. All the writes go to database servers, which then replicates the
> written data to the database server(s) dedicated to servicing the reads.
> 
> Currently, AFAIK, many OpenStack deployment in production try to take
> advantage of MySQL (includes Percona or MariaDB) multi-master Galera cluster.
> It is possible to design and implement a read/write separation schema
> for such a DB cluster.
>  
> 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.
>  
> 
> Actually, OpenStack has a method for read scalability via defining
> master_connection and slave_connection in configuration, but this method
> lacks of flexibility due to deciding master or slave in the logical
> context(code). It's not transparent for application developer.
> As a result, it is not widely used in all the OpenStack projects.
> 
> 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.
>  
> 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. 
>  
> 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.
>  
> 
> Moreover, I'd like to put it in the mailing list in advance to
> make sure it is acceptable for oslo.db.
> 
> I'd appreciate any comments.
> 
> br.
> Li Ma
> 
> 
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>  
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20140810/40fbbbe4/attachment.html>


More information about the OpenStack-dev mailing list