mysqljsonscalabilityslicehostmemcachedb

Worrying about scalability of a new site


I am building a webapp that has the following characteristics:

  1. It only has a small number of pages, home,contact us, about,singup,etc.
  2. Each user has one jquery-based page that allows them to drag/drop/manipulate DOM elements.
  3. When a user has finished manipulating elements they can hit Save and elements are sent via JSON to a PHP script on the server. They can also Load previously saved JSON.

So essentially: very few pages with 90% static information. One page with client-side work and potentially a lot of GETting/POSTing of JSON.

I have built a POC of this using PHP/Smarty, jQuery and mySQL. User details are stored in mySQL and so is the JSON data. Webpages are cached by Smarty on disk.

Now I'm thinking about scalability and the obvious question is should I be storing the often-changed JSON data in mySQL or should I be using memcacheDB or some other key-value store? Would you go for the easy mySQL option or introduce a key-value store now or would you wait to see if scale issue arise? Am I realistically ever going to reach a point where mySQL is the bottleneck?

I'm planning to host this on Slicehost to begin with and then move it if need be.


Solution

  • Question is, would there be any lookups based on these values or not? Is there going to be updates for specific values at database level or not... Serilaized data or json is going to be faster and more efficient(storage wise) if all you do is pull the entire string and have no requirements to query or modify it.

    Based on how you scale though, you may want to keep a key/value structure along with a flat data representation for lookup purpose.

    Also consider using apache AB for some benchmarking and getting ideas on how your changes effect your concurrent output.

    Good luck :)