Skip to content
tezvyn:

What are the major challenges of blue/green deployments with relational databases?

Source: docs.aws.amazon.comMediumHow cards are made

What are the major challenges of blue/green deployments with relational databases?

Tests decoupling schema and code changes in stateful blue/green deployments. Strong answers cover the additive-then-deletive pattern, backward compatibility for both app versions, and shared DB risks. Red flag: split DBs with no rollback or sync plan.

What's really being asked

This question tests whether you understand that relational databases are shared infrastructure across blue and green environments rather than per-environment state. It probes your ability to manage schema evolution safely when two application versions must coexist during a deployment window, and whether you know how to decouple schema changes from code changes to preserve rollback capability.

The full answer

A strong candidate first states that both environments must share the same data store so that green can take over production and blue remains rollback-ready with current data. Next, they explain the decoupling pattern: schema changes should happen separately from code deployments. The first phase uses additive changes before the cutover, such as adding new tables, columns, or relationships, while ensuring the old application version can still read and write safely. The candidate should mention that applications must ignore unknown fields during deserialization to avoid runtime errors, and that triggers or backfill jobs may populate new structures from old-version writes. The second phase applies deletive changes only after the green environment is stable and the old version is no longer needed, removing obsolete columns or merging entities. They should emphasize that both phases require backward compatibility: the old code against the new schema for additive changes, and the new code against the old schema if schema lags behind code.

The mistakes people make

A major red flag is proposing completely separate databases for blue and green without a viable synchronization or rollback strategy. Another weak answer treats schema and code as a single atomic deployment, which eliminates safe rollback because reverting the code leaves the database in an incompatible state. Candidates who suggest destructive schema changes before cutover, such as dropping columns the old application still needs, demonstrate a lack of appreciation for the overlap period. Ignoring the need for application-level tolerance of extra fields is also a subtle but important miss.

What usually comes next

An interviewer may ask how you would handle a long-running migration on a large table without locking, or how you would verify that the old application truly has no latent dependency on a column you plan to drop. They might also ask about data consistency requirements when sharing NoSQL stores versus relational databases, or how to automate the additive and deletive phases in a CI pipeline.

A concrete example

Suppose you need to replace a monolithic user profile table with normalized contact and preference tables. In the additive phase before cutover, you create the new tables and add foreign key columns to the original table, then deploy a trigger that populates the new tables on every update from the current application. The green environment is deployed and validated while the old application continues to run, ignoring the new columns. Once you confirm no rollback is needed, you enter the deletive phase: remove the old columns and drop the trigger, leaving only the normalized schema for the new application version.

Interview question

When evolving a shared relational database during a blue/green deployment, which sequence preserves rollback capability?

  • a.Perform destructive schema changes like dropping columns before cutover to enforce green compatibility.
  • b.Provision isolated databases for blue and green, using event streaming to keep them in sync.
  • c.Apply additive schema changes before cutover while maintaining backward compatibility, then apply deletive changes only after green is stable.Correct
  • d.Atomically deploy schema migrations and green code together so both switch simultaneously.
Why?

Additive changes before cutover let both app versions run safely against the shared database, while deletive changes are deferred until rollback is no longer needed. Treating schema and code as a single atomic deployment is dangerous because rolling back the code would leave the database in an incompatible state.

Just read this? Test yourself on what you have been reading.

Read the original → docs.aws.amazon.com

You just looked this up. Could you explain it out loud?

That is the part interviews actually test. Tezvyn takes questions like this one and gives you what the interviewer is really checking, the answer that lands, and the mistake that ends the conversation, in the four minutes before your next meeting.

The iPhone app is on the way

We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.

Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.

Get it on Google PlayiPhone app coming soon

We are hiring for this. Open roles that interview on ci/cd — each one lists the topics its interview covers.

See open roles