I have a mysql db which has around 150 millions inserts per day and retention period is around 60 days.
- Each record is indexed on id.
- Everytime a update happens as follows:
- Look if record is present. If it is , update the same with new data.
- Or else create the data.
- Delete records which are created more then 60 days before.
My main use case is follows:
Run some bulk queries. eg.:
Select (*) from table where prop=val1 and prop2=val2 etc
Will returns large no of records eg. 1M
Is following approach good:
- Have a master DB with index on id only. Have a retention of 60 days.
- Have Read Replica DB. This DB will be indexed on many columns
- All bulk queries will be run against read replica DB.
Is this a good solution?
EDIT : I plan to use Amazon RDS DB and found this in their documentation:
Q: Can my Read Replicas only accept database read operations?
Read Replicas are designed to serve read traffic. However, there may be use cases where advanced users wish to complete Data Definition Language (DDL) SQL statements against a Read Replica. Examples might include adding a database index to a Read Replica that is used for business reporting, without adding the same index to the corresponding source DB Instance. If you wish to enable operations other than reads for a given Read Replica, you will need to modify the active DB Parameter Group for the Read Replica, setting the “read_only” parameter to “0.”