
Ask HN: How do you scale? - nchuhoai
Hi,
I'm a college student who is very interested in making scalable web applications. I have the opportunity to do a directed study with my professor. My task is to find ressources from which I could learn. To start with, I'm looking for a guide or list of approaches or technologies that are both established and emerging these days.<p>I know about or played around with NoSQL, NodeJS, database sharding etc. but unfortunately, I have not found a comprehensive guide yet.<p>I'd appreciate any help
======
devs1010
Below are just some basic points, I figured I'd try to put some info in the
comment rather than linking to a resource. This is by no means comprehensive,
just what I've learned from working at companies so far that have larger-scale
apps

\- modularize, use SOA architecture (making modules accessible via a service
call so that they can be run on different servers, if necessary), this enables
parts of an app that receive heavy use to be clustered separately (as part of
an app may be very critical but another module may be able to go down for a
few min without causing a major problem, the main reasoning for this is to
save on the cost of clustering the entire app)

\- avoid holding state in singleton objects, this way no extra code has to be
written to synchronize them among different nodes running the same module

\- use session locking, so that a user's session is locked to a specific node
in a cluster (this enabls ease of saving state for that specific user as they
remain on one node throughout their entire session)

\- use a database abstraction framework with caching (such as JPA), this
enables automated synchronization of the cached data among nodes

------
benologist
Check out <http://www.highscalability.com/>, it's a terrific blog full of lots
of resources from many different perspectives including people on the ground
scaling massive systems.

~~~
byoung2
Those writeups are helpful in the same way that watching NASCAR prepares you
for a driving test. There is a huge gap between scaling your typical web app
and running Amazon, Twitter, or Facebook. Between the millions of small web
apps out there and the few hundred that warrant setups written about on
highscalability, there are sensible steps you can take toward scaling that
involve sensible architecture choices, database structure and indexing, layers
of caching, load balancing and failover, etc. This is where the low hanging
fruit is, and I think this is a good place to start.

~~~
Joakal
I disagree. I've found it useful for a list of buzzwords that I can later look
up as keywords. Plus, the organisations using it proves that there tends to be
merit. You also provided keywords too though.

Also, I saw some posts that talk about bottlenecks as they scale up. You can't
really get this from looking at software documentation unless they really
emphasise it.

~~~
byoung2
You've proved my point. Watch NASCAR and you'll see there are certain
challenges that will only present themselves when you're driving 200+ mph.
These can be useful to keep in mind as you are learning how to drive for the
first time, but there are more immediate issues to focus on, like how to hold
the steering wheel properly, shift gears, and use the gas/brake. It won't help
much in the practical sense to study advanced drafting techniques at that
point if you can't even pull out of the driveway, but if it helps motivate you
over the long term, then that's fine. Similarly, I don't think it is
beneficial to talk about switching to MongoDB and node.js because you think
PHP/MySQL is slow when you haven't even learned how to add indexes and
caching.

