Home 5 Lessons Learned Running Node.js in Production

5 Lessons Learned Running Node.js in Production

Yammer is one of a growing number of companies running Node.js in production. At NodeConf today Yammer engineering lead Matt Eernisse shared some lessons the team has learned from running Node.js in production.

Code Organization

Iterative development in Node.js is easy – maybe a little too easy. Callbacks contribute to the confusion. You need to be careful or you’ll quickly end up with spaghetti code.

App Dependencies

Dependencies are an issue for Node.js. NPM is improving – and Eernisse said he wishes it had been available when his team started working with Node – but it’s not there yet. Neither are third-party modules. Yammer deals with this by “slurping up” all the dependencies, modifying them in-place and then pushing them back out.

Assume Things Are Going to Go Wrong

Eernisse says you should assume callbacks are going to go wrong and make the default condition an error message. Cancel the error if things work out. This is pretty common in the UI side. Log all the errors so that you can figure out what’s going on later.

Visibility, Metrics

Eernisse says you should measure and log everything from the very beginning. Yammer uses this metric library.

Ops

Communicate with ops, because they are the ones that are going to have to deal with problems in the middle of the night.

About ReadWrite’s Editorial Process

The ReadWrite Editorial policy involves closely monitoring the tech industry for major developments, new product launches, AI breakthroughs, video game releases and other newsworthy events. Editors assign relevant stories to staff writers or freelance contributors with expertise in each particular topic area. Before publication, articles go through a rigorous round of editing for accuracy, clarity, and to ensure adherence to ReadWrite's style guidelines.

Get the biggest tech headlines of the day delivered to your inbox

    By signing up, you agree to our Terms and Privacy Policy. Unsubscribe anytime.

    Tech News

    Explore the latest in tech with our Tech News. We cut through the noise for concise, relevant updates, keeping you informed about the rapidly evolving tech landscape with curated content that separates signal from noise.

    In-Depth Tech Stories

    Explore tech impact in In-Depth Stories. Narrative data journalism offers comprehensive analyses, revealing stories behind data. Understand industry trends for a deeper perspective on tech's intricate relationships with society.

    Expert Reviews

    Empower decisions with Expert Reviews, merging industry expertise and insightful analysis. Delve into tech intricacies, get the best deals, and stay ahead with our trustworthy guide to navigating the ever-changing tech market.