zero gravitySOLUTIONS
← All insightsARCHITECTURE / ARCHITECTURE DECISION GUIDE

Deciding when a service deserves its own deployment.

QUICK ANSWER

Extract a deployment when independent release or resource isolation solves an observed constraint. Choose the smallest useful boundary and prove its benefit with a pilot before also transferring business data ownership.

Inside this article 6 sections

A capability deserves its own deployment when independent release, resource isolation, or operational ownership solves an observed constraint large enough to justify a new distributed boundary. Code organization alone is insufficient. First establish which changes must become independent and which responsibilities will move with them.

A separate process can be useful without a separate database or repository. Conversely, a service with its own repository may still require coordinated releases because it shares database writes or assumes a caller's internal data model.

Measure the release coupling you want to remove

Consider an illustrative SaaS application with a document conversion module. Its dependency updates occur more frequently than changes to the account application, and large conversions occasionally exhaust process memory. Those are two candidate reasons for a separate deployment: release cadence and resource isolation.

Inspect recent changes rather than counting commits. Record which releases required cross-module coordination, which deployments were delayed by unrelated work, and which failures affected other capabilities. A busy folder does not establish a need for independent operation if every change still depends on the same account transaction.

Separate avoidable coordination from useful coordination. A product change that intentionally modifies both permissions and conversion behavior should still be reviewed together. Extraction should remove incidental deployment dependencies, not conceal a genuine business dependency behind network calls.

Original deployment decision matrix · document conversion
OptionConstraint it addressesNew obligation
Module in existing processCode ownership and test boundariesShared memory and release remain
Separate worker deploymentCPU/memory isolation and worker rolloutJob contract, health, and shutdown handling
Independent service and data ownerAutonomous business lifecycleNetwork failures, data consistency, and service operations
The smallest boundary that solves the observed constraint may be a worker deployment. Independent data ownership is a further decision.

Draw the runtime contract before moving code

Define what the new deployment accepts and what it returns. A conversion worker might receive an immutable source object reference, requested output format, operation ID, and account context. It should produce an output reference and an explicit terminal state. Passing an entire application database model creates an accidental dependency on fields the worker does not own.

Decide who authorizes the operation, who owns its durable state, and who verifies the output belongs to the requested account. The worker may need narrowly scoped object access, but it should not receive unrestricted account-administration permissions merely because the old process had them.

Version the contract for overlapping deployments. During a rolling release, old and new workers may consume messages at the same time. A producer cannot assume that publishing new fields instantly upgrades every consumer. Add compatible fields first, migrate readers, and retire the older form after queued and replayed work has a defined path.

Account for the work created by another deployment

List the additional configuration, build pipeline, runtime identity, monitoring, deployment rollback, capacity policy, and on-call responsibility. These are recurring obligations, not just initial setup tasks. The service needs someone who can diagnose a failed conversion when the original module author is unavailable.

Compare the expected benefit with these obligations using concrete observations. If conversion crashes repeatedly interrupt account operations, isolation has a clear value. If the only motivation is that the codebase feels large, improve module boundaries and build feedback first, then reassess.

Do not translate every operational obligation into a speculative monetary figure. Engineering hours, incident exposure, and infrastructure spend have different uncertainty. Record what is measured, what is estimated, and what the pilot must establish before committing to full extraction.

Separate data ownership from process isolation

A worker can initially call an application-owned operation API while the application retains the authoritative workflow record. This provides process isolation without immediately moving business state. It also means the worker is not fully independent: the API and its availability remain dependencies.

Moving data ownership becomes justified when the capability has a coherent lifecycle and needs independent business decisions. Before transferring writes, map transaction invariants, reporting consumers, and repair tools. The shared database migration guide explains why a table split alone does not create that ownership.

If the conversion output is derived and reproducible, object storage plus a durable operation record may be enough. If it carries an approval or billing consequence, its version and commit semantics matter more. Let those requirements determine persistence rather than automatically creating a database for every service.

Run a reversible deployment pilot

Route a bounded workload class to the new worker while preserving the same operation interface. Choose work that exercises realistic file sizes and failure modes. Shadow conversion can compare outputs, but it must not emit duplicate customer notifications or charge for both executions.

Measure whether account operations remain healthy during a conversion memory failure, whether the worker can deploy independently, and whether operators can identify and recover a failed job. Verify rollback with already accepted work, not only with an empty queue.

Keep the old implementation available only for the defined pilot period. Route results through an explicit owner so two implementations cannot both publish the final artifact. A feature flag chooses behavior; it does not resolve conflicting writes or duplicate side effects on its own.

Decide from the pilot rather than the diagram

Keep the boundary if it demonstrably removes the original constraint and the team can sustain its operating obligations. Narrow it if a separate process solves the problem without independent business ownership. Stop the extraction if coordination remains unchanged and the new service adds latency or recovery complexity without a compensating benefit.

Record what changed in the architecture decision. The modular monolith decision record supplies the original extraction triggers; this review tests whether one has actually been met. Architecture design can connect release evidence, runtime contracts, and operational ownership to a deployment boundary that earns its cost.

FROM INSIGHT TO ACTIONSoftware architecture consulting

Choose a deployment boundary that earns its operating cost.

We can assess release evidence, design a versioned runtime contract, and test a reversible extraction before expanding its scope.

Explore architecture consultingDiscuss your architecture

Start with your goals.
We’ll work through the next step together.