Prepare for and Deliver Into Production

Production changes everything. Your customers will use your software in so many untested ways that you’ll get lots of slow requests, errors, and unexpected behavior in your software. To fix those, you need insights about what causes all these problems. So it’s vital to prepare for that.

One part of that preparation is to implement monitoring in the form of logs, metrics, dashboards, and alerts. First, you should Favor Logging Over Console Output, which we’ll explain to you in a moment. Next, you should set up a central place where all your logs go. If the logs are also searchable and you can analyze them, compute metrics, and visualize them in a dashboard, that’s perfect. Then, you might be able to derive key insights and thresholds, like how many orders were placed within the last 24 hours. And if such a metric is below a target threshold, you’ll probably want to alert the person who can bring that metric up again. For things like this, we can recommend the Open Source Elastic Stack[64] and Graylog.[65]

Errors and exceptions in production deserve our special attention. They’re neon signs for bugs in the code and holes in the tests, which makes their stack traces and context information really valuable. That’s why it’s important to collect and track any exceptions that have occurred automatically. And don’t forget the front end if you’re building desktop, mobile, or single-page applications—a lot of exceptions happen there. We recommend Airbrake[66] for the back end and Sentry[67] for the front end.

But even if you’re prepared for production, there’s another issue: How long does it take you to put a change of a single line of code into production? Can you answer that question for your current project? The longer the time to production is, the harder it is to fix something quickly, roll back a change, or ship a new feature that’s ready. Continuous integration systems are your friend here. Most of them can be configured to not only build a fully integrated system, but also to deploy it into a production environment.

Of course, we can’t cover a full release strategy in this section, but if you want to know more, there’s an excellent book dedicated to the topic: Release It! [Nyg18].

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.12.166.131