4 Best Practices to Ensure Smooth Deployments

These four best practices help crystalize the benefits of Agile deployments, including tools and techniques that you can put to work today.

Agile development has radically transformed the deployment process, but that doesn't mean everyone is realizing all of the benefits.

#1. Use Rolling Updates

Deploying large scale changes to a code base is extremely stressful. If something breaks, you may need to quickly roll back the deployment before production users notice and spend a lot of time figuring out what happened. Some development teams are familiar with midnight deployments (so as not to affect production users) and the subsequent all-nighters hunting bugs.

Agile development attempts to avoid these issues by deploying small batches of code on a more frequent basis. If something breaks, it's easy to roll back and identify the issue. There's less risk of introducing systemic bugs into the system since each deployment only impacts a small subset of the application.

Feature flags can be especially helpful. Using tools like Split or Rollout, you can easily flag features in your code base and manage them from a central interface. Turn features on for specific users (e.g. beta users) to see how they perform, as well as quickly switch them off if any issues come up.

#2. Embrace Automation

Continuous integration and deployment (CI/CD) tools have dramatically improved the deployment process through automation. Manually deployment, especially across multiple servers, is a recipe for disaster. One miss and you could be forced to carefully undo each step to restore the original system state. Scripts can help alleviate some of these issues, but if you have multiple versions floating around, they can be unreliable, too.

With CI/CD tools like Jenkins or Codeship, you can write a centralized deployment script and tie it to an application's code repository. When a developer merges a feature to a production branch, it can automatically trigger a deployment.

Test-driven development, or TDD, plays an important role, too. With automated tests in place, any new code that's merged into a production branch can be automatically tested by a CI server before moving into deployment, which dramatically cuts down on the number of bugs that ultimately reach production users.

#3. Setup Helpful Alerts

Deployment notifications alert the team when a deployment has started, failed, or successfully finished. The CD process means that you have a lot more moving parts that can be hard to track without the right tools in place. For instance, deployments may be triggered at any time and the production environment is in a constant state of flux. Automated tests help cut down on production issues, but they aren't enough to stop every error.

Using tools like Bamboo, you can easily send notifications via email, Slack, Hipchat or other team messaging platforms. And you can quickly track down what commit may have caused a production error.

It's equally important to have a plan. For example, you should know who's responsible for rolling back the deployment if an error occurs in production and who is responsible for assigning out bug reports for follow-up. You may also want to tie all of these things into a status dashboard for production users to stay informed.

#4. Load Test Beforehand

Automated tests provide confidence in an application, but unit and integration tests don't guarantee error-free performance in production. For instance, a simple N+1 query can result in significant latency for large database queries and ultimately crash an application with many production users. Load tests are necessary to identify these potential bottlenecks.

The challenge with conventional load testing is the time it takes to create, maintain and run these tests. Manual scripts take a lot of time to write, and tend to be brittle due to rapidly changing user interfaces. At the same time, running load tests with real browsers (the most accurate form of load testing) is often time- and resource-intensive.

LoadNinja’s Record and Replay Interface – Source: LoadNinja

LoadNinja addresses these issues in a few ways:

  • Record and replay capabilities make creating load tests as easy as running through steps in a browser window. No scripting necessary, so anyone can create complex tests.
     
  • Cloud-based browsers make it easy to scale tests from tens to tens of thousands of browsers to get accurate results.
     
  • Diagnostic tools, such as the VU Inspector and VU Debugger, let you drill down to the cause of performance issues without having to read through log files.
     
  • Jenkins integrations can add performance tests to your automated test suite, which run on a timely basis to identify any issues before they reach production.

Enough Practice, Time to Deploy

Agile development has dramatically improved deployment processes. By focusing on smaller and more frequent deployments, new code changes are less likely to cause major issues and any problems can be quickly identified. The tools and techniques we've covered in this article can help realize these benefits while avoiding some common pitfalls.

Sign up for a free LoadNinja trial
Make your deployments smoother than ever today!

Close

Start Your 14 Day Free Trial

By submitting this form, you agree to our Terms of Use and Privacy Policy

Ensure your web applications reliably perform under any condition

  • Record and playback test scripts in minutes with no dynamic correlation or coding
  • Generate accurate load with real browsers at scale for realistic performance data
  • Analyze browser-based performance data that developers and testers can understand out of the box
  • Visualize, isolate and debug any performance issue Virtual Users encounter