

What do I need to do to prepare my Android app for heavy usage? - oingo

Traffic handling? Load balancing? Fault tolerance? Cloud computing? Map reduce? Database optimization?<p>I&#x27;m writing an Uber-for-X type of platform.<p>I&#x27;m overwhelmed with all of this stuff and I don&#x27;t know what to start with or how to start it ...<p>Thanks
======
o_rodriguez
As others have mentioned, YAGNI[0]. You have to avoid the tempting sirens call
and wait until you actually have scaling problems, before anyone can tell you
how to solve them.

Make sure you follow "best practices" in whatever parts of the app you're
building. Also try to have some good instrumentation in place, like New Relic
for server usage/app performance and Sentry/Bugsnag/etc for catching
exceptions if/when those happen.

If it's mostly a client-side app that runs on someone's phone, then there
really is no central scaling bottleneck. If you're worried about scaling the
backing API, I'd start with one of Amazon's Elastic Load Balancers and put two
micro EC2 servers behind it. If you get a ton of traffic, you can easily take
one server out to increase its size without bringing the app down, or you can
just add more micro/small servers and scale horizontally.

[0]:
[http://en.wikipedia.org/wiki/You_aren%27t_gonna_need_it](http://en.wikipedia.org/wiki/You_aren%27t_gonna_need_it)

~~~
oingo
Thanks a lot.

So, I'm guessing I should opt for AWS right off the bat ? (vs, say a normal
VPS like DO?)

~~~
ascendantlogic
AWS will be significantly more expensive than DO. Unless you need enterprise-
grade scalability at your fingertips and have the cash on hand to ramp to
that, you may want to start with a handful of Digital Ocean or Linode boxes
and see what the traffic looks like.

------
DigitalSea
The reality is you can't. Dealing with more traffic than you expected is a
good problem to have. You can lay down the ground work by using something like
AWS (Amazon Web Services) and using auto scaling to increase resources when
load increases. At the same time, premature optimisation can be a costly
mistake. If you prematurely assume your app is going to be more popular than
it is, you could end up with a massive hosting bill because you spun up 200
large Amazon instances and only get 100 users.

My advice would be to read this link:
[https://www.airpair.com/aws/posts/building-a-scalable-web-
ap...](https://www.airpair.com/aws/posts/building-a-scalable-web-app-on-
amazon-web-services-p1) \- it details building a scalable web application and
I know of one startup I worked with who found it useful.

~~~
oingo
Wow .That link looks amazing, thank you!

------
ascendantlogic
Someone couldn't possibly answer this question without you giving insight into
what it is your app does, what kind of traffic you're seeing now (if at all)
or even what kind of traffic you reasonably expect to see.

~~~
oingo
Sorry. It's an Uber-for-X platform.

~~~
ascendantlogic
Alright, what is the current architecture? Is the app just a dumb client and
the intelligence lives on the server? Or is it flipped where the intelligence
is all in the app and the server is just a central dumping ground for data?
How In the course of regular usage, how many times would your app talk to your
server? What would be the average size of those data transmissions? What would
be the size of the edge cases? I'm not being pedantic for pedantry's sake. You
need to have answers to all of these questions before you start thinking about
capacity planning and high availability.

~~~
oingo
I'm trying to draw up a schematic on paper, so this is it...

1) The app will essentially be the front-end. The user will only be using the
app to make payments, view a map (with cars on the road), track their car,
request / cancel a car, and provide feedback.

So the heaviest usage would be from the server to the user and not the other
way around.

I'm not sure how much Google Maps uses up per minute and how much data is
needed to push a car's new position to the phone. That would seem to me to be
intensive though, especially over thousands of people.

Edge cases would be 0 and 25 cars live on a map.

Also, I currently have one droplet with DO. Am I supposed to have at least 3?
(website, app, DB )

