Hello.
I take the first steps in the design. Today drew a trace chart

The main idea lies in the division of Reading / Writing in the database.
')
The class for reading randomly selects the SLAVE-Server and connects there for reading.
The Write class works directly with the master server.
The base DB class uses caching for queries. (Already understood that caching should be rendered in read)
Also the READ class is connected with a user who can only SELECT
It is included in the client services factory and it turns out that even with script errors, the attacker will not be able to write to the database.
I see here, plus the fact that you can provide a class for working with the database to a remote programmer.
In general, the first steps, do not kick much, indicate the obvious disadvantages of this idea.
Thank.