Imagine this scenario:
You’ve created a multiplayer game app for a mobile platform such as Android. You successfully set it up with one server, you figured out how to do that. It works quite well.
To your surprise, the game TAKES OFF. Server demands explode. You need to scale, but you have hardly any experience with running a single server, let alone running multiple servers in tandem.
What do you do? Is there a service (Heroku-style) to help with such a thing? Anything? Or do you need to hire someone with a certain skill set and the necessary experience?
1
1. On app level
Running an app on multiple servers isn’t terribly hard. There are techniques which are difficult to understand and implement, but there are also some basic techniques any one can use.
Learn those basic techniques. If it’s not enough, then yes, you’ll have to find a freelancer or to hire a developer.
2. On infrastructure level
Running servers yourself (read “at home”) is very difficult. Most of the small companies which believe they have their data center are doing it wrong. Their “data centers” are not secure, badly managed, not protected against problems with power, etc.
Many developers, including myself, have a PC at home which runs day and night. We call them servers. They are not, but it doesn’t matter, since it’s funny to say: “I have a server at home”.
Other people are using hosting companies, which most often don’t include any scalability. If you’re intended to use a fixed number of machines forever, you’re lucky. If your app starts to be very popular, issues arise.
Cloud as a technical term, i.e. something like Windows Azure, not *cloud” as a marketing buzzword, like iCloud, helps you to solve that. You can easily scale the infrastructure from one to hundreds of servers in a few minutes, then to scale down again if needed.
The first three things you want to do are profile, profile, profile.
To be able to effectively scale, you need to know exactly what it is that needs to be scaled up. Whats the bottleneck? Is it concurrent connections? database access? Heavy processor usage due to your code? Once you find out the problem, then you can make an informed decision about what to do next. I’ve seen cases where the need for new servers was averted by simply adding a few new database indexes. Make sure you are using your current resources as efficient as possible first before adding more servers into the mix.
1
One of the fastest ways a small startup can burn profit is by spending it all on trying to meet demand. There are good reasons why companies like AE
charge $10 per mobile app and that’s because the infrastructure is expensive.
You might have stumbled across a mobile app that is a great idea, and no one else has done it. When you release it you realize the reason no one has done it is because the cost of IT resources exceeds what people are willing to spend for the app.
Cloud storage is a great example. The majority of people use free accounts, and that means the small percentage that buy storage also pay the coverage so everyone else can have a free account.
You need to figure out how much to charge to cover the cost of upgrading your infrastructure to support sudden success, but also avoid the mistake of spending all your money to just break even.
One of the big problems with mobile development compared to other platforms is the very low expectation of how much apps cost. An app that sells for $1.99 and moves over 100,000 units might sound like the developer is making a lot of money, but might cost over $50k to develop and server costs run above $10k+ per month.
Wise developers create apps that are loosely coupled to data servers, and offer high user value with the lowest development efforts. Sadly, this is often difficult or impractical for most projects.
I’m not sure if I answered the question, but I’m trying to warn you to budget
your business expenses first. Don’t assume that because you can run it on a cheap server and no one else is doing it. That this will translate into profits if you scale up, because the odds are it might be an idea that is difficult to profit from at a larger scale.
You’ve got a few options.
- Engage, or partner with someone who knows how to do this.
- Move your server to Amazon AWS/EC2 or similar type services.
It’s pretty likely that whoever you engage with for option 1, will probably just do 2 for you.
These “cloud” type hosted solutions are pretty awesome, typically you pay for what you use and usually include the option of being able to spin up extra servers on demand to handle load (ala EC2). Combined with sufficient bandwidth and uptime these providers are a far better option than hosting the server locally. Which is more than likely against the Toss of your home internet connection ;)?
Profiling your server will get you so far, but if you saturate your connection you’re still dead in the water.
First off, it’s a nice problem to have, try not to spend too much time mitigating it upfront though.
Start with working with two load balanced machines early on, if you can spread load across two you can across many. With two servers you can make a head start getting vertical scaling down.
If need be you could start out with two small VPS’es to save on hosting costs. Added benefit is some redundancy and you can lean on one while you update/reboot the other etc. Plenty of benefits!