1. Library
  2. Podcasts
  3. To Be Continuous
  4. Ep. #14, Staging Servers and Continuous Delivery
To Be Continuous
43 MIN

Ep. #14, Staging Servers and Continuous Delivery

light mode
about the episode

In this episode, Edith and Paul discuss a blog post by Edith in ReadWrite. In the article, Edith asserts that you should kill your staging servers so that continuous delivery can live.

For more on Continuous Delivery you can follow To Be Continuous on Twitter at @continuouscast.

The Death of Staging Servers
Pets Versus Cattle
What Counts as a Staging Server
Data Migrations and Sandboxes
Retiring the Staging Server at CircleCI
Waterfall Deployment at Salesforce
Where QA Belongs
Rethinking the QA Team
Soak Time and Launch Day

transcript

Edith Harbaugh: Harbaugh is biased.

Paul Biggar: I don't believe that for a second.

There's some semantics around the use of staging server, right?

Edith: Are you going down the whole pets versus cattle thing?

Paul: I'm going down the pets versus cattle thing, yeah.

If we have a security vulnerability, you know, are we gonna remember the staging box? Who knows? If you're doing feature flags properly, the concept of really having a staging server doesn't make that much sense.

Edith: The staging server is dead. Long live the staging server.

Paul: Hi, I'm Paul Biggar, founder of CircleCI.

Edith: I'm Edith Harbaugh, CEO and co-founder at LaunchDarkly.

Paul: And you're listening to To Be Continuous, a podcast about continuous delivery and software development.

Edith: You can get in touch with us anytime at our Twitter handle, @continuouscast.

Paul: The show is brought to you by Heavybit. To learn more, visit heavybit.com. And while you're there, check out their library, home to great educational talks from other developer company founders and industry leaders.

On this episode of To Be Continuous, we talk about Edith's article about killing the staging server.

The Death of Staging Servers

So today we're gonna talk about a post that Edith wrote on ReadWriteWeb. ReadWrite. Yeah. The post was about the death of staging servers.

Can you give us a little bit of an introduction to what the post is? Because I think we're going to talk about it quite a bit.

Edith: Sure, Paul. Happy to. By the way, did you read it yourself?

Paul: I confess I may have skimmed it a little more than read it.

Edith: Yeah, so I'll give you the summary and then we'll talk about it and then you should go read it and then we'll talk about it again.

So the article is an outgrowth from what I was seeing with LaunchDarkly, my company. So already one of the comments I saw on it is, and I like this comment because they talked about me in the third person. They said, "Harbaugh is biased. But by the way, she does have a good point."

So I'll state up front, yes, I'm very biased. My company makes a platform to manage feature flags. So my bias though is I've seen what our customers are doing. And so the reason why I wrote the article is that this was a natural extension to the way I saw our customers using feature flagging.

Paul: So were your customers using your product wrong or was there a thing that was happening that you're talking about?

Edith: So feature flagging in its most basic is very simple. It's just an if-then statement. You know, you don't need LaunchDarkly or any sort of system to manage that. You can just put a conditional into your code.

What happens after that is you get more sophisticated and you want to have some sort of dashboard where you can see the different feature flags that are visible and up-level them. Not even just to the business side, but even amongst the various developers. You know, you want to have a central place where you can manage. And then, so that was kind of our 1.0, is just you can manage feature flags.

The next thing that our customers were asking for on a roadmap was support for environments. That they wanted to be able to have feature flags on dev, QA, staging, production, have visibility all in one place.

Paul: I'm a little confused when you say this, because surely an environment is just a flag.

Edith: Yes. Go on.

Paul: It seems like you could say, you know, have another flag that is a string that is like staging or production or dev or whatever, that you flag features on.

Edith: And that's basically what LaunchDarkly is doing. So for us, we just have another flag. So each environment gets an API key.

Paul: Okay. So again, forgive ignorance on this, why not use the existing flag? What was missing from the existing feature flag infrastructure that meant environments had to be a separate, like, top-level or first-class feature?

Edith: So now we're getting a little meta. So the reason why people liked using LaunchDarkly is because they could get then a consolidated view of all their feature flags, so that they could not just have these floating around in a config file for each machine, but have a roll-up of what flags are turned on and off for different environments. And then on top of that, the ability to manage the flags in different environments.

Paul: Gotcha. So they wanted a view that applied to just their environment.

Edith: Well, to see per environment what was turned on and off. So basically they were following a software life cycle where, you know, you had dev people working on their developer boxes, pushing a QA, pushing a staging, then pushing to production.

Paul: Gotcha. When features moved from one to the other, was there a human promoting these or was there like an API call promoting these?

Edith: At this point it's mainly human. I can see down the line that it would just be an API.

And even beyond that, so then the next thing people asked for is once they got more people on board LaunchDarkly, were using more feature flags, is they wanted the ability to have lockdown of different flags in different environments.

Paul: Lockdown, like people can't change the flags?

Edith: So they wanted QA to have rights and QA to change some flags, but not in production.

Paul: I see. Okay, yeah.

Edith: Then after that, the natural step then is like, okay, if you have a feature flagging system where you could control at any step who sees permissions, who gets to see what, why do you really have a separate QA, staging and production box? Like, why not just collapse all this and manage visibility with a feature flag itself?

Paul: Sure. That makes perfect sense. Like, all the feature flags provide the primitives on which you can build the things that they want.

Edith: Oh, and more, the point I made in the article is that people use this abstraction of a QA in a staging environment to basically try to encapsulate a change. So that was the original intent and at the time it was very good because the alternative was just to push everything to production to have everything break.

Paul: Right, right, right.

Edith: But if you're actually doing your...

Paul: Doing feature flags properly, then the concept of really having a staging server doesn't make that much sense, because you're not pushing a feature to the staging server, you're pushing a feature to production and then slow rolling it to people, and really having it in the staging server doesn't make that much sense. Is that kind of the point?

Edith: Yeah, so that was the title of the article, "Kill the Staging Server."

Paul: Gotcha. This might be a good point to actually stop and read the article.

Edith: Yeah, I'd appreciate that.

Paul: All right.

Edith: Thanks for...

Paul: We're gonna take a, what's gonna appear to be a 10 second break, but it's actually gonna be a five minute break while I read the article, and I recommend you press pause and read the article yourselves right now.

Pets Versus Cattle

Edith: So welcome back. Paul's been furiously whiteboarding and I'd love to hear his thoughts now.

Paul: Yeah, so good article. Really liked it. And the first thing that kind of came to mind was the concept of names. So the idea of having multiple environments is kinda a weird one in particular.

So if you imagine that you have, you know, service-oriented architecture and it's got like six machines or something like that, or it's got twenty machines or whatever, the idea that you can't spin up a new instance of it is kind of a little bit odd.

So, you know, what people have done historically, and this, you know, goes back to when things ran on machines at particular ports or whatever, was everything had a name. It had a DNS name or it had a staging name. And if you look in, like, you know, Rails configuration files, there's a production name, there's a staging name, there's a dev name, there's different environment variables for all these.

But it doesn't actually really make sense to have a name, because a name implies there is one of them.

Edith: Well, this goes back. Are you going down the whole pets versus cattle thing?

Paul: I'm going down the pets versus cattle thing. Yeah. If you're naming your pets, then you can't just, you know, suddenly get six of them, you can't suddenly kill them. But what you really want is cattle.

So like, a staging server is not... I mean, a staging server is a pet. And a very, very important pet that everybody loves and everyone plays with, and it gets a little bit confused as a result of it. So the analogy went...

Edith: I'm not sure if you're agreeing with me or disagree with me, so we'll continue. It would be great if you disagreed, but I would also enjoy it if you agreed.

Paul: If that analogy holds, then what you're suggesting is that we kill the cherished family pet.

Edith: Well, you know, sometimes I... I can't even go there.

Paul: Well, the analogy breaks down, but let's say it's probably for the best if that pet spends some time on the farm.

Edith: Went for a long walk.

Paul: Right, right. So obviously production is an actual thing that needs a name. It is a unique environment, but nothing else is really a unique environment.

Edith: Yeah. And to fast-forward, I mean, I think, so I got a lot of feedback on the article, which I loved, because that's kinda why I wrote it, to get feedback. I think there are cases where you do want to not go directly from a developer to production. I think there are many cases where you want to have other places to test them.

Paul: I do agree with this, yes.

Edith: I think a lot of the cases, though, of a forced march of we go from this step to this step to this step to production is actually very harmful, when if you just push stuff much quicker and perhaps skip some of these steps, you can get the feedback you want directly.

Paul: So what we did at Circle, and initially we had a staging environment. And we would occasionally use the staging environment if we wanted to test something that wasn't that easy to write unit tests for, or something along those lines.

And usually for us that was stuff around LXC or stuff around starting Amazon boxes, things that you didn't really do that often and that either had an expense or had a weird architectural thing where you couldn't just do it in software and practice it in software.

So I think that there is that need, right? You know, occasionally you have things where it's not tested well enough, so you need to put it up somewhere where, you know, a human validates to the best of their knowledge that it actually works. And you could put that in your... I was gonna say you could run it on VMs or that sort of thing, but no, like, the whole point of the staging server in that situation is that it's something which isn't really that easy to put into VMs or whatever.

The other kind of use case that you see is where you don't want to be running stuff on live production databases and you can't get a copy too quickly. So you see people like Heroku trying to build products that avoid the need for that. So with Heroku they have a new... You know, you can take a copy of a database, you can have a view or a read-only view on a database that's a copy-on-write in some way or whatever, so that you don't actually need, you don't need a separate staging environment or a separate copy or separate staging database or whatever.

But yeah, if everything is well tested, if everything works in software, then there's really no need for staging environments. So that says to me that a staging environment is sort of a yellow flag somewhere that it shouldn't really exist, but sometimes you might need it.

Edith: Yeah, I actually want to write a follow-up article now of, you know, the staging server is dead, long live the staging server. Because I do think that there are use cases where you don't want to push to prod. I do, however, think people...

Paul: What are the use cases where you don't want to push to prod?

Edith: So what I heard from Sean Byrnes, our advisor, is if you're testing a really deep infrastructure change, for example, switching some batch processing.

Paul: No, I don't believe that for a second.

Edith: Alright.

Paul: So if you're testing a really deep infrastructural change, there's kind of two ways to do that deep infrastructural change. One of them is to say, "We're gonna have these machines over here, we're gonna have these machines over here." And that's the quarterly release cycle thing. It's the, you know, "We're taking a big, big risk and all hands on deck" and whatever.

The way that you want to be releasing that sort of thing is that you wanna have it, you know, in the code base. You wanna have an if statement, a feature flag, that controls how much of the data goes one way or the other, and you, you know, duplicate the data, or you put one percent of it through or whatever.

Edith: I think the key you said there is to duplicate or have some fail-safe. I mean, the biggest risk you run with doing this is data loss, which is awful, if you're cavalier about how you do this.

Paul: Well, I mean, I don't think data loss is the worst thing. Like, the worst thing is your whole damn service goes down.

Edith: Well, the worst thing is your whole damn service goes down and you lose a day's worth of somebody's data. I think people are actually more forgiving of a five minute blip than you losing, like, a lot of their analytics. So his point was, so he had been at Flurry, was that, you know, we basically cannot afford to lose people's data.

Paul: So it would be ludicrous then in my mind to create a whole brand new infrastructural thing where you're gonna do some kind of like overnight or immediate change or wait-for-downtime change or something. Like, if the data's all live, you can't afford to have, "We're gonna switch over and see if it works," regardless of how well it's tested. Like, it's ludicrous.

Edith: Yeah, I mean, so that was... Now I'm coming back around to my article. I mean, that was the point I was making. People think that they are reducing risk by doing all this test and staging.

Paul: Yeah, yeah, yeah. In fact, they're increasing risk.

Edith: Yeah, you think you're...

Paul: I mean, the whole point of continuous delivery is that by having a harsh crossover between one thing and another thing, you increase risk even though you think you're decreasing risk.

Edith: Yeah, so Kent Beck wrote a really good article about reversibility.

Paul: Okay.

Edith: So he's at Facebook now. But he said everything at Facebook is reversible.

Paul: Interesting.

Edith: And that this actually makes you much less risky because you're like, "Okay, we make these risky, risky changes."

Paul: But they're reversible, so it's, right.

Edith: Yeah. Versus the more the cutover, as I said, and I called in the article "waterfall deployments."

Paul: Right, right. I mean, I think that's a really good way of thinking about it. And it ties it to a name that everybody knows is bad.

Edith: Well, it was a deliberate...

Paul: Yeah, good choice. So the agile deployments then are the ones where it, you know, happens seamlessly and you can go back and forth and change the requirements and whatever else.

Edith: Yeah, I mean, so that was Sean's example number one, was, well, what if it's a really risky backend change? And he had some good examples from his own career.

Paul: Did he have any examples that I would agree with?

Edith: Well, a priori without hearing them, I don't know if you're gonna agree or disagree. Another thing people brought up was it just seems very risky to people. It seems to increase risk, 'cause I think they're used to thinking of staging server as a safe harbor.

What Counts as a Staging Server

Paul: I think there's some semantics around the use of staging server, right? You very often want to have a complete copy of your environment that you can test against. Right. So is that a staging server, or is that, you know, where you type, I don't know, "Docker up," you know, new environment, and then you run your testing on this whole brand new infrastructure that has never been touched by anything before?

Edith: Yeah, and the critique I made in the article is I think people do that a lot and they expend a lot of energy testing there, but these are artificial test cases.

Paul: So I guess there's two things. So one, yes, if you spin up a separate environment, you are getting an artificial test case. But often that's an actual useful artificial test case. For example, you want to do a load test.

Edith: So that was Sean's other example.

Paul: Okay.

Edith: So Sean's other example, and by the way, I think Sean is great. He's an advisor to our company, brilliant guy.

Paul: I certainly wasn't saying anything different to that.

Edith: But I disagree with him on some points. He said he would do load testing to the point of failure.

Paul: Okay, so the distinction that I was trying to draw there between the staging server and another environment that you can spin up. Why is staging special?

Imagine that you're doing a load test and someone else is also doing a load test on the staging server at the same time and you get the wrong results, or someone else is fiddling with the staging server or the staging environment or the staging data center or whatever the hell it is. Everyone should have unique environments for doing this sort of testing and you should have everything in a Docker Kubernetes something magic.

Edith: That's the future, dude.

Paul: Exactly. Something that's the future. And you type the one command that gives you your own unique environment and you run your load test on it and then you kill it. And instead of costing thirty thousand dollars, it costs three hundred dollars.

Edith: Yeah, so that was actually the original idea for LaunchDarkly, was a company called Continuous.ly, continuously, which was exactly that, that we would have the ability to do push-button spin-ups of environments.

Paul: Good thing you didn't do that.

Edith: Well, why not?

Paul: Because Docker would have killed you.

Edith: We didn't do it because just the tooling wasn't in place when we were thinking about this idea. But conceptually, John and I both really knew that this was very useful.

Paul: Right. Well, I mean, imagine if the tooling had been in place, if Docker had just started and then you started building this, and you could have been a cheap acqui-hire for Docker at some point down the line.

Edith: Well, Paul, you can't A/B test life.

Paul: So load testing. What were Sean's other examples that these are?

Edith: Load testing and infrastructure. And others I've heard.

Paul: So the infrastructure thing I just don't buy at all.

Edith: The load testing, I agree, you don't want to load test to failure in production. I'd say the greater risk I see, and I've seen this from people who've come to LaunchDarkly, because they load tests in staging, they're very happy.

Paul: Yeah.

Edith: They push it to production without a feature flag.

Paul: Everything that we're talking about here is risk. Right. And you can do something in staging to reduce risk, right? You get more information about, you know, how many hits per second this thing can really, you know, can really handle. And you get more confidence and the risk goes down.

But, you know, if you test something in staging, you still haven't reduced the risk to nothing. And so you still need a feature flag when you roll it out to production.

Edith: Well, I am very biased in this matter.

Paul: I mean, I'm very biased in this matter as well, in the sense that I don't want people to write shitty software, or services that we rely on to go down because people think that a staging server is a good enough test to reduce the risk when you still have risk at the end of it.

Edith: Yeah, and that's a thing. I think I'm not advocating for willy-nilly coding and just pushing everything immediately. I'm just saying that you can't really test something unless it's in production.

Paul: Yeah. I'm trying to imagine a situation in which when you run something on a staging server, you have absolute confidence that it's gonna work. And if you can't get absolute confidence, then you still have to have feature flags or whatever. You still have to be able to slow roll it in production.

And then the advantage that you think that you're getting from the staging server is, you know, over feature flags... I mean, I guess the advantage of the staging server is that you don't need feature flags. You don't need to test in production. And you've lost that benefit then.

Edith: Yeah, and then you've added all these other costs.

Paul: Right, right, right. I mean, the cost of staging servers is insane. When we had staging servers, and I think we've moved to per-developer environments that you can create or destroy. But when we had staging environments, it was like, "Is anyone using this? You know, has anyone done a database dump into this staging environment recently?" And then with the database dump, there's the horrible thing of trying to make sure that the data that's in it, you know, doesn't have any secrets in it, and it's a complete nightmare.

Edith: I know, it's a nightmare. You're spending so much time to replicate production. And then nobody...

Paul: Yeah, you're fake replicating production.

Edith: You're fake replicating. Nobody wants to do it because they know it's gonna get blown away. Like, you know, everybody has been burned.

Data Migrations and Sandboxes

Paul: So here's one place that I would say a staging server is useful. But again, it's not a staging server, it's a staging environment or staging set, or, you know, when you're doing data migrations.

Edith: Yep.

Paul: When you're doing very big data migrations, that's something that, unless you have some sort of immutable data, what's the name of it, like lambda architecture or, you know, whatever those things are where you never actually overwrite data, in that case, you want to make sure that the migration goes well. And so what are you going to do? You could theoretically say, "Okay, we're going to take a copy of the data into the staging server, we're going to run the thing." But really what we're talking about here is you want to take a copy of the data somewhere and run it onto it.

And it doesn't matter that there's a staging server involved or that the staging server is involved or these staging environments is involved. What matters is you have something and you could call it, you know, "data migration twelve Paul's test."

Edith: Yeah, I mean, I put it more that you wanna... Maybe I should bring back the word sandbox.

Paul: Sure. I mean, a sandbox is a better term than environment, because environment implies a named thing. And if instead you say, "Oh, we're gonna run this in a sandbox," it kind of implies that, you know, you've got a new thing that no one else is interfering with or touching.

Edith: Oh, and also that it's temporary, that it's gonna get stomped on. Like, 'cause the sandbox is this environment.

Paul: Yeah, yeah, yeah, yeah.

Edith: You know, it's gonna get rained on, people are gonna rake the sand out.

Paul: So one thing, when I was reading through your article that came...

Edith: Thank you, Paul.

Paul: Another thing that came to me was different teams have different requirements. So you were talking about the QA team and so on.

So when you have different environments, what you get is teams are protected from other teams.

So you have a staging environment and maybe that's for the developers. You have a QA environment that's for the QA team. And they, you know, the QA team doesn't need to talk to the application developers or whatever, it just needs to talk to the ops team.

But again, this is a thing where, you know, someone on QA could just have their own environment or just spin up this environment for ten minutes and, you know, spin it down at the end. I don't see any advantage to having, you know, an actual staging environment.

Edith: And then there's a further perversion which I saw, which is somebody would want early access to a feature. So like, you know, I would do more... If you're doing any sort of sales and somebody wants to see an early feature, then you give them access to QA, and then all of a sudden everything goes sideways.

Paul: Oh Jesus, yeah, yeah. No, that seems like a complete nightmare.

Edith: Well, because there's somebody who really wants to see something early and you give them access to a really sloppy environment. And then there's all these other issues, then all of a sudden you get emails like, "Hey, nobody touched the QA box because we're doing a demo."

Paul: Right. We had a stage where our staging environment was Googleable.

Edith: Oh.

Paul: I mean, it was fine because, like, it's the same code base, it's got the same security protections and that sort of thing. But our docs linked into the staging environment, which were... You know, how often did we update the staging environment? So they were out of date and whatever, and so it was important obviously to get that out of Google.

Edith: Yeah, it's just... I talked about the article about how when you try to have a separate beta server or...

Paul: Right, yeah, yeah. Similar concept there. Except it's harder to tell Google not to go to the... Actually, I suppose it's easier to tell Google.

Edith: That's pretty easy to put in the text.

Retiring the Staging Server at CircleCI

So Paul, I'm really interested to hear about CircleCI and why you transitioned to not having a staging server.

Paul: Well, so the major thing... Well, actually there was a couple of major things. So the staging server was one server, right? Because we didn't want to be running all these... We use really expensive boxes. So we didn't want to have ten of them that were sitting idle doing nothing, right?

We wanted one of them. And when we had a staging environment, it was largely kind of, you know, one or two people using it and they'd coordinate.

And then when we started having more people, you know, whose turn was it to use the staging box and who's responsible for it? What software was on it? Like, if we have a security vulnerability, you know, are we gonna remember the staging box?

Edith: Yep.

Paul: I mean, we should, but like, who knows?

Edith: Yeah, there's just all these issues that just start adding up.

Paul: Yeah. So instead we started having per-developer staging boxes, and then we added tooling as well. We would have the per-developer boxes would appear in our, you know, standard fleet management stuff. So we'd be able to kill... If we had security issue or something like that, we'd just kill all the dev boxes.

Edith: Yeah, like cattle.

Paul: Yeah, exactly. They were all cattle, and if you wanted another dev thing, you know, there was a single command that you run and it would come up.

So the reason that we have per-dev environments, or the reason that we had a staging environment, was that we had some stuff that was really tough to test. And in particular, you know, we have a bunch of...

So Circle works by having a big, big Amazon box and then splitting it up into 10 or 12 or 15 or whatever it is containers, like LXC containers. And then there's fleet management stuff that runs across a set of boxes that does it. And so it was kind of tough to test that in production.

If we wanted to, you know, test, does the new thing, you know, destroy our queuing mechanism or something like that, it was tough to test that, something that ran across multiple boxes in the fleet or whatever.

And then the other thing that was tough is stuff that touched LXC. So our testing environment, you know, obviously we tested Circle on Circle, but you couldn't run LXC tests within the Circle environment.

Edith: Go ahead, go on.

Paul: You seem like you have a joke to make here.

Edith: No, it was just...

Paul: No snark? It seems like you're really holding it in.

Edith: I'll tell you later, Paul.

Paul: We couldn't test LXC stuff and we couldn't test fleet-level stuff. And so on the staging environment, we still couldn't test fleet-level stuff because it was just one box. And then we also, we could test LXC stuff. And there wasn't a very good solution for testing LXC stuff.

We didn't have, like, mocks or stubs for LXC call. We did, but we kinda didn't. So we had a bunch of stuff. We had some typed Clojure things where we had more statically typed things for those kind of namespaces, and then we had the ability... You know, "If you're really gonna mess with this, let's start a staging server, let's run a bunch of things and make sure that it still works." And so it gave us a little bit of confidence that, you know, the code did what it was supposed to do.

Edith: What were some of your issues with the transition?

Paul: There really weren't any issues with the transition because it's not like we got rid of a staging server when we were using it. You know, we'd use the staging server sporadically. And then we switched to a per-dev environment, so we just started using the dev environment and then staging went off and died.

Edith: Oh.

Paul: Yeah.

Edith: Did you ever...

Paul: Just taken that back and shot.

Edith: Did you ever have a deliberate decision, like, "We're gonna stop using it," or was it just more like a dwindling?

Paul: I mean, it was one of those things where, like, for a couple of weeks people are going, "Oh, this staging server's a nightmare, the staging server's a nightmare, we really should have pro-dev things." And so like, you know, someone did a little bit of the work to get enough of it working for them, and then sooner or later, you know, no one's using the staging server.

Edith: Yeah, I'd say, so I was gonna make a joke and say that I think staging servers are technical debt, but they're much more than technical debt. They're actual real money.

Paul: They're, I mean, they're real money debt, they're security debt, they're all sorts of debt.

Edith: Yeah, and can you talk about the security debt?

Paul: Well, it's just what I said a few minutes ago. If you have a vulnerability, which everyone has all the time, and you take care of it and you forget to fix your staging server, it's another, you know, attack vector.

Edith: Yeah. It's just...

It's ironic that something, I keep saying this, that something that's supposed to reduce risk and, you know, save effort is actually this huge time sink.

Waterfall Deployment at Salesforce

Paul: So someone was telling me about the Salesforce data centers and, you know, machine models and that sort of thing. And so they have a new release every quarter. I think it's every quarter. But for every quarter, what they do is there's a new data center, and they run the code in the new data center in parallel to the, you know, to the existing stuff, and then they, you know, migrate one data center over from the old code to the new code at a time.

And this just seems like the craziest fucking shit I've ever heard. It's like, who would think that this is a way to deliver software, and especially for, like, the pioneer in SaaS? Like, it's insanity.

Edith: Well, it's waterfall deployment.

Paul: It is waterfall deployment. It's pure waterfall, and, you know, fair enough, they started in 2000 and they're a big company now and they have all these enterprise customers who have all these enterprise requirements, but like, I mean, I would not like to work there on that environment.

Edith: Yeah. I mean, so my real hope is... So I wrote the article to be provocative. I think there are many cases where people should keep using this existing workflow, but I hope it's the same sort of case as what you just said, that if you're using feature flags effectively, at some point you look at what's happening, you're like, "Hey, this is just... We could shrink this. We can move this quicker."

Paul: If you have a staging environment, there's a reason that you have a staging environment, right? And if there's no reason you have a staging environment and you could just use feature flags, well, you can kill it right now. But there's some reason that you are holding on to your staging environment. Maybe it's a part of your code base that you can't test, maybe it's something that you need to load balance, maybe it's something along those lines.

And I think, you know, the obvious thing for people who have a staging environment is, you know, make it so that you could have any environment, right? Don't feel the need to claim the staging environment. Just, you know, kill the concept. Make it something that you can spin up immediately over there.

Edith: Yeah. I mean, I go back to... I loved it when Kevin from Microsoft was our guest, when he was talking about slimming down their release process. You know, and he basically did the Kanban style of why.

Paul: Right.

Edith: Like, why do we have a staging server? To reduce risk. Okay, is it actually reducing risk? Or why do we have a staging server? Is it to give certain customers early access?

Paul: Right.

Edith: Okay, could we do that on production?

Paul: Right. Let's make a feature over there that does that. That's exactly what I'm talking about. Generally there'll be some risky aspect that has to be had in a staging server, or that has to be had in a staging environment.

Then you get to the things where they actually need a staging server, right? So you've got one copy of that piece of hardware that you need, or you've got a thing where you actually need one staging server. Maybe there's access controls that you can't deal with. And I'm not saying that those things will go away, but they're probably not very good things to have organizationally.

Edith: Yeah, I really like the word sandbox the more I think about it.

Paul: Yeah.

Edith: I guess in this world, how closely do you think the data set should match between this sandbox and production? And I guess it depends on what you're trying to test.

Paul: Right, right. One of the things that we can do that works really well. So our front end is a single-page JavaScript app. And you can have a single-page JavaScript app running on your dev machine that connects to the production APIs.

And so you can just test in production. You can just test. It's all the same security controls, right? You're just hitting the API. It's wonderful.

Yeah. I think the answer to your question is that there's really not very much that you need a copy of the data that you need to format in a certain way. If you're doing a migration, yes, run the migration, you know, have a practice run. Whatever it is you think can give you more confidence. But generally, you know, there's not many things where you need an actual copy sitting around on some server for someone to break into while you're not paying attention to it.

Edith: Well, let's get into the nitty-gritty then. So at CircleCI, you have all your developers. Do they all merge directly in or what's your exact flow then?

Paul: I mean, there's pull requests and then you merge directly in. And there's a bunch of different services, and we slow roll both code, so we can roll back both the code base that goes out and we can also roll back... You know, well, we have feature flags for the rest of it.

So we generally put things out with feature flags on them if there's any sort of risk at all. And if there's no risk, then, you know, they'll go straight out. And obviously sometimes we get that wrong.

Edith: As usual, Paul, we agree.

Paul: Yeah, well, I mean, there's... I feel that there's something about agreeing that shows, like, there's really a lot of best practices around doing continuous delivery, and I don't think that there's a whole lot of discussion around... Or that there's a whole lot of disagreement to be had about them.

Where QA Belongs

Edith: Well, so the one other critique I heard was that I wanted to get rid of QA, and I actually don't feel like I was advocating that at all.

Paul: You want to fire the QA developers?

Edith: It was like, "Oh, this gets rid of all QA developers." I'm like, "No, this assumes that actually you have very good QA."

Paul: Yeah, I mean, QA seems like an orthogonal concern.

Edith: Can you explain more?

Paul: So you might be one of these developers that believes in test-driven development and the developers write all the tests and, you know, there's no QA at all. Or you might be one of these people who believe that having a QA team provides a valuable thing, and, you know, you can't test everything, and QA, you know, goes and uses the things in production or distills or reproduces test cases from support or, you know, whatever. Whatever QA does. But that just seems entirely orthogonal from, you know, how you do your production environment. It's not orthogonal if you inject QA as a step before something goes out, but hopefully you don't do that.

Edith: Yeah, I actually agree. I think it more depends on how a given organization thinks about the world.

Paul: Right.

Edith: And we've talked about this before, but just how much risk you want to take before anybody else sees it.

Paul: Right, right. And so the idea of having, you know, QA as a step that the software has to go through, I think it comes from a good place. And it comes from a place that's like, "Oh yeah, we need all this testing to make sure that it validates."

But I think it's a crutch, and I think it's not a particularly good crutch, because you can't manually test all the things that, you know, could go wrong, that might go wrong.

I really liked the way that Mozilla did QA. So it had its staging channel or its canary channel or whatever, you know, that there was nightlies that went out to like a million people, and then there was pre-release that went out to, I don't know, forty million people or something like that. Then there was the rest of it that went out to four hundred million people. And the, you know, developers would push straight to trunk, yeah, after peer review or code review and all that sort of thing.

And QA was there as, you know, they had all the environments and all the machines of all the different kinds that were supported. So if you couldn't track something down, there was the availability to get that. Fuzzers were being run from the QA team, so they were fuzzing security stuff and they were fuzzing anything that could be fuzzed. And in a web browser quite a lot of things can be fuzzed, so they were finding, you know, crashing reports, and they were trying to reproduce things, and test cases would come in and they would try to identify them, and they would, you know, produce reports about what the real problems are that allowed management to, you know, put focus in the right areas.

And they would keep an eye on kind of long-term stats, like how often it crashed, how much memory usage was being done, what the performance was like. So I mean, they provided really fantastic services to you, kinda in conjunction with all the other teams that were working on it. But it was never, you know, a blocking thing that, you know, every single change that each of the, I don't know, three hundred developers that are writing code has to have their step go through, you know, some overworked QA team that's trying to manually click buttons as fast as they can.

Edith: Yeah, I think that's what I was trying to convey, is I think a lot of continuous delivery so far has been, "Let's take our existing pipeline and make it easier and quicker to move between our existing steps."

Paul: Okay.

Edith: And it hasn't been about how can we really remix or rethink about...

Paul: So you are trying to get rid of the QA step?

Edith: No, I'm just trying to say maybe it could go somewhere else in the process, like the Mozilla. Like, how do we remix this model?

Paul: Right, right.

Edith: Like, given that now that it's much cheaper and easier to move between different states, what's the actual order we want our states to be in?

Paul: We talked about this in a very early podcast, that the two things that you need to make continuous delivery really work are you need to have testing and need to have a high degree of confidence that your tests, you know, work, and then that you need monitoring.

Edith: Yep.

Paul: And QA was kind of a... Or the manual people clicking things as a way of releasing software, QA was really a crutch for both of those. It was a crutch for software that didn't have automated tests, so that you would catch the things that, you know, validate that it still actually worked. And it was a crutch for bad monitoring, because you had to validate that it worked in advance, because you didn't have any monitoring in production.

Edith: Also, to go further back, it was because DevOps didn't really exist, so there was just much more of a wall of a developer.

Paul: Right, it was literally thrown over the wall. And the QA team helped the development team. I don't know, it's sort of, the ops team was happier, the dev team was happier, everyone was happier to have this extra manual step, even if it meant that software didn't go out for, you know, an extra week or whatever.

Edith: Yeah, so I think this is the intersection of DevOps and kind of having a more inclusive tent of, "Okay, we have these different groups. How can we make them work together, and not the linear fashion we have, but in a way that makes sense quicker?"

Rethinking the QA Team

Paul: So I mean, one of the things about a QA team...

Edith: And by the way, Fred just walked by and he sent you a lovely gesture.

Paul: Lovely. So the thing about a QA team, there's lots of ways that people imagine QA teams. And I think a lot of them are sort of pejorative, that the QA team is like the low level, you know, the guys who didn't get accepted onto the dev team, and they're clicking buttons, and you know, that maybe they're writing some occasional scripts and maybe someday they'll get to be a real developer or something along those lines.

Edith: And I disagree. I think QA is...

Paul: Oh yeah, no, I don't... I'm saying that this is one pejorative view of QA that lots of companies have. Right? I know people who started on QA teams because they felt everyone has to roll through the dirt before they get an opportunity to have the real job. Whereas I think that if you have that model of QA, then you're missing the opportunity to have QA do real stuff.

Edith: Yeah, absolutely.

Paul: To have QA, you know, fuzz, to find, you know, bugs that exist out there, to be able to, you know, identify broad classes of bugs that, you know, they can work with the dev team to eliminate. To, yeah, to find things that affect people in production. They can have actual useful jobs and not just be like glorified button clickers hoping to one day become developers.

Edith: Absolutely.

Paul: The reason I'm making this point is that I think that the people who... There's a strong correlation between people saying, "Oh, you need the QA, you know, step in the way before it goes out," with people who view QA as glorified button pushers. And the reason is, I think there's that sort of political need to keep their jobs, to keep the value of the QA department, and it comes from having that control on the code's journey out, rather than an actual utility.

Edith: Yeah, and it goes back to what I said of, why are we doing this?

Paul: Right, yeah, yeah, yeah, yeah. And so if you shift your understanding of what QA does, you automate the manual stuff, you have QA focus on real, you know, valuable tasks that improve the development process, then you're no longer thinking of like, "You know, we need to be in the way because this preserves our jobs or our power or whatever it is." And instead you're thinking, you know, "We're obviously going to keep our jobs in our power because of the vast utility of the service that we're providing to the rest of the company."

Edith: Yeah, and that was the point I was trying to convey in the article, is I think QA is actually much more effective and can do a better job if they're not doing the drudgery of testing the same darn issue in a separate environment four times, which is just kinda mind-numbing, but can actually focus on finding real issues in production.

Paul: Yeah.

Edith: Instead of just, you know, moving between boxes trying to reproduce phantom issues.

Paul: Right.

Edith: Which I saw many, many times. Like, do you ever have these issues with...

Paul: So I once did QA for a phone rollout back in the day, when I was... This was two thousand five, and i-mode was being rolled out in Ireland. This was a terrible idea and everyone knew it, but someone somewhere had made it happen. And so I was part of a team that was literally like clicking buttons. And, you know, we had big lists of tests that needed to be run, and then we would run them, and then things would break, and then we would wait for them to be fixed, and then we would run them again.

And it was not only was it drudgery, but it was completely ineffective at actually, like... There was a bet going around the QA department as to whether when it launched it would actually work. We really had no idea. And we largely suspected that it wouldn't.

Edith: Yeah, I mean, so Richard Feynman is one of my heroes. And have you ever read about his thing about cargo cult science?

Paul: Yes, yes.

Edith: Yeah. So this blind belief, you know, that "We're pushing stuff through QA, so therefore..."

Paul: Right, right, right. Yeah, it's secure. Especially if you're copying it from, like, "Oh, this is how Microsoft does it," you know, "This is the way it was ten years ago, and so this is the way it needs to be." Without really a deep understanding of what the process actually is or why the process is there.

Edith: Yeah. It's total cargo cult. It's like, "Oh, we push it through staging, so it has to be safe."

Paul: Right.

Soak Time and Launch Day

Edith: So I do have one contra, which I'd like your thoughts on. What do you think of the idea of soak time? And I guess I have my contra to that one too.

Paul: Soak time meaning you put out the code and you kind of, you know, wait a while for something to happen?

Edith: So usually we would kind of soak time as we would just kind of let something sit for two days or so on staging to see if any new issues happened or we thought of anything. But now, I think you can really effectively do that with feature flags, even off the actual...

Paul: Yeah, I mean, you put it out, you turn it on for a couple of projects and, yeah, let it soak, absolutely.

Edith: Yeah.

Paul: I don't see any reason that staging is the place for that.

Edith: Yeah. Like at TripIt, when we pushed out a new feature we would wait two days or three days before we'd officially announce it.

Paul: Okay.

Edith: Basically 'cause we just kinda wanted to... You know, it was live, people could use it.

Paul: Yeah, yeah, yeah.

Edith: But we didn't want to do a big PR push while we were waiting for feedback.

Paul: Well, I think the idea of connecting the launch of the software with the launch of the PR campaign is a little bit silly.

Edith: Oh, completely.

Paul: I've seen lots of places where people are desperate, you know, they're launching on Monday morning, right? So they're desperately, you know, running the death march over the weekend trying to get the code out.

And it's like, if you're launching Monday morning, the code should have been out weeks ago. It should have been turned on weeks ago, and just, like, you know, let people play around with it and discover it, and then you do the launch.

Edith: Yeah, and then you... I mean, and maybe you're only letting the beta group play with it.

Paul: Maybe you're, you know, testing it dark, and you just, you know, whoever discovers it can try it. And then, like, you know, PR doesn't need to happen on the day the code is pushed into production.

Edith: Yeah, because that's the riskiest day.

Paul: Right, yeah, yeah.

Edith: That's the absolute riskiest day, because you just push it live, and that's when you suddenly find all the actual issues.

Paul: Yeah, exactly.

Edith: All the stuff that you thought you prevented in staging always happens in production.

Paul: Thanks for listening to this episode of To Be Continuous, brought to you by Heavybit and hosted by me, Paul Biggar of CircleCI, and Edith Harbaugh of LaunchDarkly.

Edith: To learn more about Heavybit, visit heavybit.com. While you're there, check out their library, home to great educational talks from other developer company founders and industry leaders.

Subscribe to Heavybit Updates

You don’t have to build on your own. We help you stay ahead with the hottest resources, latest product updates, and top job opportunities from the community. Don’t miss out—subscribe now.