- Scale horizontally (scale out): Separate system tiers on different environments: database, Solr, memcached, push, web/app servers. Separation helps in scaling up/down tiers individually.
- Use the cloud (Platform as a Service) right away that facilitates scaling out/up/down (Google AppEngine, Heroku, AWS Beanstalk, …
- Monitor usage on each tier to scale up/down in the correct time (e.g. NewRelic)
- Use push instead of server polling (Pusher)
- Don’t use filesystems for storage, unless it is a distributed filesystem (AWS S3)
- Don’t involve your app server in long requests/responses. Slow clients may block your server and cause longer request queues (depends on implementation).
- If you want to receive an upload get it through S3 with some work on the client side.
- If you want to send a huge response, either stream it using a streaming capability of your app server, or generate it using a background job that stores it finally on S3 and sends the direct link when done through the app using push or through email.
- Defer long tasks to background jobs (Resque, RabbitMQ, Ruby delayed jobs, …)
- Don’t clutter your app server memory with language bindings, use Apache Thrift or Google Protocol Buffers to communicate between different environments
- Use Apache Solr (Lucene over HTTP) to query large data even if you don’t have full text search, it can be used for scoping and faceting as well (think SQL WHERE and GROUP BY)
- Autoscale your web/app servers depending on traffic. Monitoring shows you traffic metrics and HireFire will autoscale your heroku dynos
- Use clients-side rendering (Javascript templates) to get rid of the rendering time on the server
- Use caching in different layers (memcached) to be nice on your servers
- Asset hosting, static assets (javascripts, stylesheets, html templates, images, …) have nothing to do with your app servers so host them somewhere else (CloudFront/S3)
Wednesday, January 21, 2015
The cheatsheet on writing scalable web apps
Subscribe to:
Post Comments (Atom)
8 comments:
I stumble upon your post and found many interesting and useful information! thank you san jose website designer
Customize with easysite.com' free website builder, no coding skills needed. Choose a design, begin customizing and be online today! web hosting in Nigeria
Processing of business operations has become easier with Android app development. With a surge in BYOD (Bring Your Own Device) strategies, it has become more important for the businesses to adopt Android app developments. Android App Development has helped enterprises of all sizes create customized solutions to cater to the specific business needs and demands.xposed installer apk
Great article Lot's of information to Read about web hosting. Windows hosting always rock. I highly recommend shared hosting ...Great Man Keep Posting and update to People..Thanks
It was a very good post indeed. I thoroughly enjoyed reading it in my lunch time. Will surely come and visit this blog more often. Thanks for sharing. Ultra-Web
I have checked this link this is really important for the people to get benefit from.
web hosting in Nigeria
therefore, I would like to thank you for the efforts you have made in writing this article.
Find the best internet marketing solutions
I feel this is among the such a lot vital info for me. And i am satisfied studying your article. However wanna commentary on few general things, The website style is ideal, the articles is truly nice
Tangki Panel
Post a Comment