Yii2 - Mysql Replication

Hi everybody,

I am developing a web platform using Yii2-mySql and need your technical advice.

The platform will be used by psychologists and their clients.

The number of psychologists could be between 1 and 10.000 (at the beginning, I would expect - in my wildest dreams - around 500).

Psychologists will interact with the platform for manipulating clients data (eg., load new clients, update clients info, set up administering sessions, download reports and so forth).

Each psychologist could have between 1 and 1.000 clients. Clients will have few interactions with the platform: the administration of the personality test will be done via a backbone app which calls the server twice: at the beginning (getting data) and at the end (putting data) of the administration process.

  • First question: Given the above figures, should I care about data replication for scaling out?

  • Second question: iIf I indeed need data replication, should I be worried about slaves lags (I read somewhere that mysql performs asynchronous replications and that slaves may be not updated instantly)?

Let me thank for your support.

ANS1: given the number of users and expected db operations you do not have to worry about data replication for performance reasons.

PS1: nevertheless, you still need data backup for content security purpose. (say, backup once a day)

ANS2: to use replications, your php program has to direct all ‘write’ to master db, ‘read’ to slave.

a link might be helpful to read