The game in question is ditto like Diamond Dash. You can play it here

It will be an HTML5 game. Mostly there'll be writes more than reads and once the player completes a play session, the high score would be Ajaxed to the application server. Also, the leaderboard data will be downloaded to show the player's stand among others. But while users are busy playing, network requests would be low.

Since, the backend is going to be common for Facebook platform, Web and mobile devices, I'm expecting the number of simultaneous users will be a lot. To start with, say a million.

Static content like Javascripts, CSS and images to be used in the game would be served from Amazon S3. And the application servers would mostly store the highscores in the database with some data processing.

I'm thinking Apache for application servers and MySQL for database. I would be using Amazon S3, EC2 and EBS at the max.

Now, the questions:

  1. What should the database server setup look like? Will MySQL work?
  2. How do I handle multiple databases? Master/Slave architecture? How will replication of data happen within slaves? Is there any tool which handles replication of databases? or I have to use rsync for that?
  3. What kind of caching model would help? Is memcached needed?
  4. Amazon EC2 should do the scaling itself? Do I need some sort of load balancing?

More insight would only come after deployment and usage monitoring and analysis. But, for now I need to finalize an architecture. If something doesn't work along the way, would dump it and look for other solutions.

Any help is deeply appreciated. Thanks!

link|improve this question
Off topic per the FAQ. We are NOT about, "Product or service recommendations." – t1nt1n Dec 31 '11 at 16:48
1  
This is a question that would lead to book-sized answers, since there are a lot of variables to consider. This is an overall systems-design question requiring quite a bit of analysis to formulate a good recommendation. Application logic factors hugely, so there will be no absolutes at this stage. – sysadmin1138 Dec 31 '11 at 17:06
Yes, I agree. I'm not expecting 1 million users at all. What I want to know is what kind of technologies I should start with so that after analyzing enough logs and monitoring, it would be easy to scale later when required. – detj Dec 31 '11 at 18:05
feedback

closed as not constructive by Evan Anderson, Ward, Tom O'Connor, SvenW, Iain Dec 31 '11 at 17:25

This question is not a good fit to our Q&A format. We expect answers to generally involve facts, references, or specific expertise; this question will likely solicit opinion, debate, arguments, polling, or extended discussion. See the FAQ for guidance on how to improve it.

1 Answer

You should ask your development team for help on the specific architecture decisions.

If you've got more experience among your team with MySQL, use MySQL. If you know Oracle inside out, use that.

That bit is simple. You use whatever it is you're most familiar with.

Handle replication as per the best-practice methods for that particular database server software.

Yes, memcached is excellent. As is higher-level caching, but it won't work very well for logged in pageviews. Look at Varnish for a reverse-proxy cache.

Amazon EC2 won't do scaling itself, unless you tell it to. Look at their Elastic Load Balancer offering.

Start small, and work up. You're unlikely to get 1,000,000 visitors. There's other games like yours, what's your USP. How will you get your Million Visitors?

Monitor everything. Log everything else. Make sure you've got multiple levels of monitoring, both server-side, as well as user-experience monitoring.

link|improve this answer
Thanks for answering. MySQL is our preferred option as most people in our team are familiar with it. Amazon ELB is a little expensive so, I was thinking of any alternative. – detj Dec 31 '11 at 18:09
I will take a look at Varnish.. Thanks – detj Dec 31 '11 at 18:09
1  
ELB costs $15/month. Rolling your own will be at least that expensive, and nowhere near as reliable and scalable. – ceejayoz Dec 31 '11 at 18:37
@ceejayoz at least, if not more. – Tom O'Connor Dec 31 '11 at 18:52
feedback

Not the answer you're looking for? Browse other questions tagged or ask your own question.