working on Monolithic, SOA and Hybrid microservice applications which can at most 1 master and 1 salve (To immediately recover from master failure but reads never happened from it). How is SQL databases scaled horizontally in big companies. I have few queries
1. How will SQL be scaled to 1 region for example India. Can we have multiple masters instance for writes and we can have multiple slave instances so that reads can be on slave.
i. How eventual consitency is maintained for systems like facebook, blog or someother systems where immediate consitency can he okay.
ii. If I am working on mission critical system like Banking, Stocks then I need consitency over availability how is that achieved.
iii. How can we achieve data replication from master to slaves with low latency.
2. Now I want to go globally as shown in the image attached. How will the above system scaled
i. Will every region have multiple master instances and we will have multiple slave instances.
ii. How will the data replicated from one region to another region with low latency. At first point will it be replicated?
iii. Will caching happens region wise or central.
iv. Think that I want to pull some reports from all over the world databases. How will database table join works? How does the data aggregation works?
3. How are database definition or manipulation (ie adding or removing columns) is handled so that it should reflect immediately throught the world database centers immediately. May be your company might go for canary deployment, how can it be achieved.
4. What if there is global interest in the data for example some corona pandemic or israle war scenes or afaghansitan issues where everyone are watching them how the data is cached or made highly available
5. How does the maintenance of the master instances happen.
6. How will other region application know about some other regions ip address for replication or other interactions? Will you implement some kind of Service Registery & Service Discovery? If yes then which software and how will be your approach
Databases scale vertically.
You cannot scale vertically to cater huge amount of users and that too who are globally situated
If you know any ways to achieve horizontally scaling kindly let me know.
depends on your requirements and load you can go with either NDB or with galera. both have their own cons and pros. also try to take a look at vitess (i do not have any experience with it but it claims that it can scale database horizontally)
Awesome. Thank you
Обсуждают сегодня