Scrivio Interview library
LeadershipPrincipal6 min read · updated 12 November 2026

Over the years, engineers have built many ad hoc coordination mechanisms on top of databases (advisory locks, flag rows, polling tables). A new platform team proposes replacing them all with a workflow engine. How would you assess the proposal?

I would assess it with evidence rather than enthusiasm: first inventory every coordination mechanism, what it coordinates, its failure history and its owner; then weigh what a workflow engine such as Temporal or Camunda really gives (durable state, retries, timers, visibility) against what it costs (new infrastructure, skills, project or vendor risk). Simple single-database coordination that works should mostly stay. I would approve a pilot on the most painful use case, decide on measured incident reduction and delivery speed, and require a migration and decommissioning plan so we do not end up running both forever.

Why this question is asked

Every few years someone proposes to replace a messy set of home-grown mechanisms with one clean platform, and they are usually half right. The mess is real, but a big platform migration has its own costs, and some of the mess is actually doing its job well. Interviewers ask this leadership question to see how a senior engineer evaluates a proposal fairly. In this answer, we will build an inventory, weigh the engine's benefits and costs, decide what should not move, design a pilot with measurable success criteria, and plan the migration and decommissioning.

1Start With an Inventory

Before judging the proposal we need to know what we would replace. The inventory lists every mechanism: advisory locks guarding jobs, flag rows that mark a process as running, polling tables that drive multi-step processes, cron jobs that check for stuck states. For each one we record what it coordinates, which services depend on it, how often it caused incidents in the last two years and how severe they were, and who owns it today, if anyone.

The inventory usually shows a clear pattern. A handful of mechanisms coordinate long, multi-step business processes across services, with timers and retries, and cause most incidents. Many others are simple, single-database locks that have quietly worked for years. That split is the core of a good decision.

2What a Workflow Engine Gives and What It Costs

A workflow engine such as Temporal or Camunda keeps the state of each process instance durably, retries failed steps with policies we configure, provides durable timers (wait three days, then remind the customer), and shows every instance's history in a UI. For a process like onboarding a merchant over two weeks across five services, that replaces polling tables, cron sweeps and custom retry code with a model built for it, and makes stuck instances visible instead of discovered by customers.

The costs are just as concrete. It is new infrastructure that must be run, secured, upgraded and backed up, or a managed service with its own bill and data handling questions. Engineers need new skills: Temporal's deterministic workflow code and Camunda's BPMN models each have rules that are easy to break. And there is project or vendor risk, from licence changes to the engine becoming a single point of failure for every process.

Workflow engine versus existing mechanisms
AspectWorkflow engineAd hoc database mechanisms
Long multi-step processesbuilt in: state, retries, timerspolling tables and cron sweeps
Visibility of stuck workper-instance history and UIcustom queries, often none
Simple one-job locksheavy for the jobcheap and proven
Operationsnew cluster or managed servicethe database we already run
Skillsnew programming model to learnfamiliar SQL and Spring

3What Should Not Move

Simple coordination inside one database is often the best tool available. An advisory lock that makes one pod run a nightly job, or a unique constraint that prevents duplicate processing, is a few lines of code with clear behaviour, no network dependency beyond the database, and transactional guarantees a workflow engine cannot offer when the work is in that database. Moving them adds latency, failure modes and dependencies for no gain.

So the assessment should state plainly that mechanisms without an incident history and without missing features stay as they are, unless they are part of a process that moves for other reasons. That also makes the proposal smaller, cheaper and easier to approve.

4A Pilot With Measured Success

Instead of approving a company-wide replacement, I would approve a pilot on the most painful use case from the inventory: the process with the most incidents and the most custom code, ideally owned by a team willing to try it. Before starting, we agree on success criteria, for example: incidents for that process down by half over a quarter, time to build a typical change down measurably, on-call pages down, and no new class of outage introduced by the engine.

The pilot runs for long enough to see real failures, one or two quarters, and includes the operational work, not just the happy path: upgrades, a failover drill, and an on-call rotation. Then the decision is made on the data. If the pilot succeeds, we have a reference implementation and trained people; if it does not, we have learned cheaply.

Step throughAssessing the proposal
  1. Inventory mechanismspurpose, incidents, owner
  2. Pick the most painful use casemost incidents and custom code
  3. Pilot with agreed criteriaincidents, delivery speed, on-call load
  4. Criteria met after one or two quarters?
    Yesexpand by process, with a planNokeep current mechanisms, fix the worst
  5. Decommission what was replaceddated plan, owners, no permanent dual running

5 steps in order. Play them, or step through them one at a time.

5Migration and Decommissioning

If we expand, the plan moves processes one at a time, choosing them by pain rather than by convenience, and each migration includes removing the old mechanism: its tables, cron jobs, alerts and code. A process that runs on both the engine and the old polling table at once is worse than either, because nobody is sure which is authoritative.

The plan needs dates and owners, and the engine team's success should be measured by mechanisms retired and incidents reduced, not by workflows deployed. Without that, companies commonly end up running the new engine for new processes and the old mechanisms for everything else, permanently, with two sets of skills and two sets of incidents.

6Follow-up questions

Temporal or Camunda, how would you choose?

They suit different styles. Temporal expresses workflows as code in Java or other languages, with durable execution and strict determinism rules, which suits engineering-owned processes. Camunda models processes in BPMN, which business analysts can read and sometimes edit, and suits processes where that shared model matters. The pilot should test the one that fits how the chosen team works, and licensing and hosting options should be checked for the current versions.

How do you handle in-flight processes during migration?

Usually by letting existing instances finish on the old mechanism while new instances start on the engine, with a cut-over date per process. For very long-running instances, a one-time migration job can create engine instances at the right step, which must be tested carefully on copies of real data.

What if the platform team is already building it?

Then the assessment is still useful, framed as making it succeed: agree on the pilot use case, the success measures and the decommissioning commitments now, so the investment is judged on outcomes and the scope stays focused on the processes that need it.

7Conclusion

In this answer, we saw that assessing a workflow engine proposal starts with an inventory of every coordination mechanism and its incident history. The engine brings durable state, retries, timers and visibility for long multi-step processes, at the cost of new infrastructure, skills and project risk, while simple single-database coordination that works should stay. A pilot on the most painful use case with agreed success criteria decides the next step, and any expansion comes with a dated migration and decommissioning plan.

What to say in the interviewAbout 80 seconds aloud

Open with

I'd start by building an inventory of every mechanism: advisory locks, flag rows, polling tables, cron sweeps, with what each coordinates, its incident history and its owner. That usually shows two groups: a few long, multi-step processes with timers and retries that cause most of the pain, and lots of simple single-database locks that just work.

Then, if they want more

A workflow engine like Temporal or Camunda is genuinely good at the first group. It gives durable state, configurable retries, durable timers and a history of every instance, so stuck processes become visible. But it costs new infrastructure or a managed service, new skills with real pitfalls like Temporal's determinism rules, and project or vendor risk.

For the simple locks it adds dependencies and loses transactional guarantees, so those stay unless there's a real problem. I'd approve a pilot on the single most painful process, with success criteria agreed upfront, like incidents halved over a quarter, faster changes and fewer pages, including operational work like upgrades and failover drills. Then decide on the data.

If we expand, every migration includes decommissioning the old mechanism with dates and owners, so we don't end up running both systems forever.

About this answer

Last updated
12 November 2026
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "Over the years, engineers have built many ad hoc coordination mechanisms on top of...": https://scrivio-interview-library.netlify.app/databases/database-locking/79e5794b4c/