Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools

high traffic website

hi guys!

I am looking to make a high traffic website (like yelp) and would like to know what are the recommended technologies to build such a website.

What methods would be recommended to ensure fast and scalabitltiy.

1 Answer

sungwon choe
sungwon choe
15,044 Points

I'm no expert, but I've been researching and thinking a lot about scalability in my job recently.

The unsatisfying but legit answer is that it really depends on what you're building.

Don't worry about it unless you really need to First of all, though, are you building a website that must be scalable from launch? I.e., do you have hundreds of thousands of users now? If not and if it's a new app just worry about the business logic first. Just concentrate on getting a working app to start with and then worry about scalability later if it can attract users.

Use memory, avoid calls to disk If you are sure you need to be scalable from launch, one of the first things you want to think about is what kind of data you are dealing with. In computing, whether for your laptop or a webserver, the bottleneck is almost always the hard drive. You can make your web app much faster by avoiding expensive database calls and by storing and serving data from memory (RAM) rather than disk. One way to do this is to cache database reads. Another way, and if you have a simple database structure, is to use an in-memory (No SQL) database like mongo, redis or cassandra. Even if you have to do a lot of relational database calls (like joins), you could use a No SQL database as a write cache and store data temporarily that is moved to your slower RDBMS (MySQL, Postgres or other) with a separate process.

Webservers For a webserver, these days nginx seems to be a high-performance alternative to apache. So an example technology stack might be: nginx, mongodb and node.js. Another example might be, nginx, postgres, redis (as a cache), ruby on rails.

SOA If you are really building the next Yelp and need enterprise-class scalability and extensibility, you should consider taking a SOA (service-oriented architecture)-oriented approach. This basically means dividing up your app into a bunch of modular services that talk to each other over an internal API. There's a good example of how this works (including a caching example) by a livingsocial engineer using a rails stack at: https://techblog.livingsocial.com/blog/2014/05/06/soa-the-what-the-why-and-the-rules-of-engagement/ The advantage of SOA for scalability is that if one piece of your functionality (a "service") needs more resources, you can add the required appropriate resources (servers, memory, etc.) just for that one service. For huge applications and teams, it's also just easier to work with.

TL;DR By now you might be thinking, what the #@$, this is complicated, I just wanted to know what the fastest tech stack is. Yeah, it is complicated and unfortunately there is no one stack that will be the fastest in all situations.

But there are a bunch of new technologies and services that make all of this less complicated. They all basically just take care of the backend for you, so all you have to worry about is the business logic and frontend experience. Here are some: http://nobackend.org/solutions I've been experimenting with https://www.meteor.com/ So far it's been fun and fast.