Deploy Like the Pros

In those old days of the late 2000s, deployment was a completely different concern than design. Developers built their software, delivered a binary and a readme file, and then operations went to work. No longer. Deployments are frequent and should be seamless. The boundary between operations and development has become fractal. We must design our software to be deployable, just as we design software for production.

But great news! This isn’t just an added burden on the already-behind-schedule development team. Designing for deployment gives you the ability to make large changes in small steps.

This all rests on a foundation of automated action and quality checking. Your build pipeline should be able to apply all the accumulated wisdom of your architects, developers, designers, testers, and DBAs. That goes way beyond running tests during the build. For instance, there’s a common omission that causes hours of downtime: forgetting an index on a foreign key constraint. If you’re not in the relational world, that sentence probably didn’t mean much. If you are in the relational world, it probably made you scrunch up your face and go, “Ooh, ouch.” Why would such an omission reach production? One answer leads to the dark side. If you said, “Because the DBA didn’t check the schema changes,” then you’ve taken a step on that gloomy path.

Another way to answer is to say, “Because SQL is hard to parse, so our build pipeline can’t catch that.” This answer contains the seeds of the solution. If you start from the premise that your build pipeline should be able to catch all mechanical errors like that, then it’s obvious that you should start specifying your schema changes in something other than SQL DDL. Whether you use a home-grown DSL or an off-the-shelf migration library doesn’t matter that much. The main thing is to turn the schema changes into data so the build pipeline has X-ray vision into the schema changes. Then it can reject every build that defines foreign key constraints without an index. Have the humans define the rules. Have the machines enforce them. Sure it sounds like a recipe for a dystopian sci-fi film, but it’ll let your team sleep at night instead of praying to the Polycom.

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

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