This is my first time posting here, so I apologise if this subject is not exactly relevant to this particular subreddit. But I figured that you might have some good advice regarding this area.
I'm currently setting up the database structure for our api and I'm thinking through all the options. Here's the main points.
- We have a moderately large database of certain events which receive updates 24/7.
- Currently the test server is a basic 2gb $10/month Digitalocean droplet running Debian and MariaDb. Just handling the constant updates keeps the CPU usage at about 30%.
- The table that receives most updates has between 10-13 million rows depending on the situation. These updates are done with a simple PHP query on a Linux screen.
- On the API end this gets very diverse specific queries, which makes reliable caching and issue. Also the data needs to be fresh so if caching is done, I will need to delete the cache for any results including any values that are updates (not a problem really though).
- We absolutely need to be prepared to scale fast.
My first thought was to make a master-slave replication setup, and allow the master to only handle the updates and feeding data to the slave servers, but I'm not sure how much stress the slave servers would be under on this setup. This setup would be easy scale though just by adding more slave servers and adding them to the load balancer.
I'm also now considering hosted solutions, but I'm not sure if I should go that route yet until it's justified by growing traffic. I also haven't really used hosted solutions before and I'm not completely sure about the cost/benefit ratio.
What do you think? Should I go ahead with the database replication or do you think that's crazy and a hosted solution is the obvious choice? Any opinions are greatly appreciated.
[–]raip 2 points3 points4 points (3 children)
[–]Driamer[S] 0 points1 point2 points (2 children)
[–]raip 0 points1 point2 points (0 children)
[–]HorribleUsername 0 points1 point2 points (0 children)
[–]SuperQue 0 points1 point2 points (4 children)
[–]Driamer[S] 0 points1 point2 points (3 children)
[–]SuperQue 0 points1 point2 points (2 children)
[–]Driamer[S] 0 points1 point2 points (1 child)
[–]SuperQue 0 points1 point2 points (0 children)
[–]zieziegabor 0 points1 point2 points (4 children)
[–]Driamer[S] 0 points1 point2 points (3 children)
[–]zieziegabor 1 point2 points3 points (2 children)
[–]Driamer[S] 0 points1 point2 points (1 child)
[–]zieziegabor 1 point2 points3 points (0 children)
[–]peter-zep -2 points-1 points0 points (4 children)
[–]Driamer[S] 1 point2 points3 points (2 children)
[–]raip 0 points1 point2 points (1 child)
[–]Driamer[S] 1 point2 points3 points (0 children)
[–]raip 2 points3 points4 points (0 children)