The Web Platform
March 7–8, 2016: Training
March 8–10, 2016: Conference
San Francisco, CA

Scaling your Node.js API like a boss

Volkan Ozcelik (Cisco Systems)
1:45pm–3:15pm Tuesday, 03/08/2016
Average rating: ****.
(4.38, 8 ratings)

Prerequisite knowledge

Participants should be comfortable with JavaScript, have a basic understanding of how Node.js works and what an event loop is, and be familiar with basic networking concepts such as routing, load balancing, reverse proxies, etc.

Materials or downloads needed in advance

I have not decided if the session will involve hands-on coding. If it does, participants will need a laptop with the most recent versions of Node.js, Docker, Redis and NGINX installed. I'll update this page as we get closer to Fluent, so please check back for more information.

Description

It’s one thing to create a sample RESTful API using Node.js (maybe utilizing the cluster module to distribute the load), but it’s quite another to horizontally scale your architecture to hundreds of thousands of concurrent connections while trying to ensure redundancy and high availability. Knowing how to scale is important, but more important than that is knowing when to scale.

Volkan Özçelik explores what it takes to create a real-life, scalable, highly available, and highly responsive Node.js application. Volkan will also explain how to store the application state in its own cluster and why it matters.

Volkan outlines how to choose the container architecture for your (virtual) machines, how you can roll out updates to service without disrupting the users, and how you fail gracefully when things on a node go haywire. He also covers tracking down memory leaks and coming up with short-term (i.e., restarting your nodes when they become too beefy) and long-term (i.e., actually spotting where the leaks are and fixing them) solutions to address them.

When you dive deeper and deeper into the rabbit hole, you soon realize that scalability is a tough job that requires careful planning and consideration. The bottom line is that designing any system to scale is a never-ending adventure, and there is no limit on how deep you can dive.

Photo of Volkan Ozcelik

Volkan Ozcelik

Cisco Systems

Volkan Özçelik is a technical lead at Cisco. He has been in the industry since 2003, which means that when he began his career, JavaScript was a “toy language” for online form validation, AJAX was just a detergent, and he had to deal with monsters called Netscape Navigator 4 and Internet Explorer 5. He believes in the beauty of simplicity and loves to architect responsive and intuitive user interfaces driven by amazingly well-organized JavaScript code. Volkan would be happy to talke with you about performance engineering, widgets, APIs, microservices, and, of course, JavaScript.

Comments on this page are now closed.

Comments

Picture of Volkan Ozcelik
Volkan Ozcelik
03/09/2016 2:33pm PST

Note:

The “audience copy” of the slides are available at:

https://speakerdeck.com/volkan/scaling-your-node-dot-js-api-like-a-boss

Picture of Volkan Ozcelik
Volkan Ozcelik
02/09/2016 9:15am PST

Notice for the attendees:

Although you’re not strictly required to run a development environment, I’ve created setup instructions for the interested ones who requested it:

https://github.com/v0lkan/talks/tree/master/fluentconf#development-setup

Note that the steps are for a Mac OS, and your configuration might slightly vary if you‘re using windows. —
And for linux, well if you are using linux, then I’m sure you’ll figure it out ;)

See you at the event!

Cheers,

V.

Picture of Volkan Ozcelik
Volkan Ozcelik
01/22/2016 2:20pm PST

Hi everyone,

In this tutorial, we will look at various aspects of creating a scalable Node.JS API. I’m excited to share tips, tricks, and pain points you’ll likely have along the way.

Scaling an API end-to-end is a shared effort that involves many teams from developers to operations, to security experts, to system administrators.

Creating a highly scalable, fault-tolerant, and maintainable system is not an easy task.

And as you continue scaling up your system, the complexity and the maintenance cost of the system increase super-linearly. — As the saying goes, premature optimization is the root of all evil.

There’s so much to cover from DNS setup, to database sharding and clustering and replication, to load balancer configuration, to DDOS attacks, to security, to memory leak detection, to remote debugging, to service discovery, auto-healing… you name it!

And there are literally books written in every single one of those subjects; which makes it virtually impossible to cover all our bases in depth.

In this talk, I’ll specifically focus on horizontally scaling our Node.JS service, and spend most of the time there. I’ll also be talking about things like Redis replication, message bus topologies, load-balancer configuration, API gateway design… and the like whenever we need a “bigger picture” view of things.

Oh before I forget; there will be live coding and live demos too. — If you want to run the demo services you might want to read this: https://github.com/v0lkan/talks/tree/master/fluentconf#installing-required-software

And if you have any ideas, comments, and suggestions to share I’d love to hear them.

Feel free to comment here, or bug me at me[at]volkan[dot]io.

Respectfully,

Volkan.