3 ms·
This is a joke right? Staging is supposed to be architecturally identical to prod, that doesn't mean it should be actually identical. In practice, this means t
by fastball 6y ago
This is a joke right?
Staging is supposed to be architecturally identical to prod, that doesn't mean it should be actually identical. In practice, this means that if your prod has 10 API servers that are load-balanced behind HAProxy or something, you can probably get away with only have 1-2 API servers in your stag environment, as long as they're still behind HAProxy. If your prod PostgreSQL primary has 64GB of RAM, in stag you can probably get away with 4GB (or less). The key here is to have the same architecture, but on smaller scale (because you're not actually trying to service your customers).
From there, if you have a staging env that costs "$100k", but you don't "infra as code" (with Ansible, K8s, Chef, Puppet, Docker, etc), you're doing it wrong. The difference between deploying to stag and deploying to prod should probably be a one-line change.
- skissane 6y ago> In practice, this means that if your prod has 10 API servers that are load-balanced behind HAProxy or something, you can probably get away with only have 1-2 API servers in your stag environment, as long as they're still behind HAProxy. I think if you have more than one instance of a component in production, you really need to have more than one instance in staging. You can get a lot of issues with more than one node (e.g. session cookie stickiness in load balancers, clustering framework issues, replication issues) which you won't get with only one. I've seen before people get burnt by production issues which they can't reproduce in staging because it only has a single node for everything.
- fastball 6y agoYeah fair point, one is probably too aggressive with the downscaling. Though a stag environment with an LB and 1 API server will still help you catch problems that you otherwise might not have caught without the stag.