Skip to main content
Technical Systems

Strategy Databases: Managing Configuration as Runtime State

How versioned rules, distribution, and decision records make changing production behaviour easier to control.

Understand how database-backed rules and feature configuration affect runtime behaviour, including validation, consistency, versioning, rollout, and the limits of rollback.

Strategy Databases: Managing Configuration as Runtime State

A payment service chooses a provider using the merchant, currency, transaction amount, and the providers currently available. Initially, those choices live in application code. As merchants acquire different requirements and operations staff need to respond to outages, the team moves the routing rules into a database.

The deployment has become easier to change, but the behaviour now depends on two independently changing things: the executable and the rules it reads. An incident investigation needs both. Knowing which code release handled a payment is insufficient if the routing configuration changed several times during that release.

A strategy database is a useful descriptive term for this arrangement, rather than a distinct database technology or universally defined architectural pattern. It stores data that selects or configures application behaviour. Feature flags, routing policies, and tenant-specific rules are related uses, although their consequences and consistency requirements can differ substantially.

Separate Stored Rules From Their Implementation

The application still needs an implementation for each supported behaviour. A routing record might select a provider and set an amount threshold, while tested application code performs authentication, constructs the provider request, and handles the response. Storing the provider name does not implement the provider integration.

Keep that boundary explicit. A constrained rule schema can describe currencies, limits, priorities, and effective periods. Arbitrary executable expressions introduce a larger language and security problem. Where a rules engine is justified, its evaluation semantics, resource limits, and testing requirements become part of the design.

A stable strategy identifier should also have a defined meaning across application versions. If release A interprets a threshold as inclusive and release B treats it as exclusive, an identical database record can produce different outcomes. Configuration compatibility belongs in release planning, particularly while old and new instances run together.

For tenant-specific rules, the evaluation inputs matter as much as the stored values. OpenFeature’s evaluation-context specification provides a concrete example of contextual targeting. In a payment system, derive merchant identity and permissions from trusted application state rather than accepting an unrestricted client-supplied tenant identifier.

Publish Coherent Versions Instead of Editing Live Rows

A routing policy often contains related settings. Changing the preferred provider without its supported currencies, limits, or fallback policy can create an invalid combination. Updating rows one at a time lets readers observe states that the author never intended to publish.

One approach is to create immutable configuration versions, validate a complete candidate, and then activate its identifier. Readers load the complete version and switch their active reference only after loading succeeds. This avoids exposing a half-constructed local object even if distribution takes time.

The database transaction boundary still needs examination. PostgreSQL’s isolation documentation distinguishes statement snapshots under Read Committed from stronger transaction-level guarantees. Several reads do not automatically describe one coherent configuration simply because they occur near each other. Design the read path to load a specific version consistently.

Immutable versions also make comparison and explanation easier. A review can show that version 42 changes euro routing for a defined merchant group, leaving other combinations unchanged. Retain the proposed change, approval, validation results, and activation event alongside the version rather than relying on a last-modified timestamp.

Publishing and observing runtime configuration
Publishing and observing runtime configuration Yes No Draft a complete version Validate and review Publish immutable configuration Activate for a defined scope Readers load and switch locally Record decisions and monitor outcomes Change needed?
Activation identifies the intended version; readers report which version they actually loaded and used.

Choose the Consistency the Operation Requires

A cached configuration can keep the request path independent of a configuration-service outage. It also means an instance may use an older version. That can be acceptable for a gradual interface rollout and unacceptable for a rule that must immediately prevent a prohibited operation.

Polling and notifications offer different distribution mechanisms, but neither alone establishes that every reader has switched. A notification can be delayed or missed, and polling has an inherent interval. Combine the mechanism with version checks, freshness reporting, and a defined response when configuration is too old for the operation.

For a high-consequence decision, the application may need to check a current authority before acting, or stop the operation when it cannot establish the applicable rule. That increases dependence on the availability and latency of the authority. Make the tradeoff explicit rather than promising immediate global updates from a database write.

A request can often pin the version it selected at entry, giving its related decisions a consistent basis. Longer workflows need a more careful policy. A refund performed next week may need the original routing decision for reconciliation while applying current security restrictions. Those are distinct facts, and a single instruction to always use the latest configuration cannot express both.

Validate Meaning as Well as Structure

Schema validation can reject a misspelled currency code or a negative limit. It cannot establish that the chosen provider has the right contract, that a routing combination is operationally sensible, or that the proposed threshold reflects business intent. These require additional checks and accountable review.

AWS AppConfig’s validators illustrate the distinction between schema-based validation and custom validation logic. The broader design lesson is to validate before activation and make failures visible. The existence of a validator does not make the policy correct beyond the conditions it checks.

Test important rule combinations with explicit expected outcomes. Include overlapping priorities, an unsupported currency, a missing tenant override, a boundary amount, and unavailable providers. Identify the intended fallback for each case. A silent fallback may keep requests flowing while sending them somewhere the business did not approve.

Configuration changes should be reviewable at the level of their consequences. A reviewer needs to know which merchants or transactions will behave differently, not merely that a JSON file remains valid. Simulating a candidate against suitable historical cases can help, provided those cases are representative and any use of sensitive data is controlled.

Distinguish Rollback From Repair

Reactivating a previous configuration can change future decisions. It cannot unsend a payment, withdraw a notification, or reverse a customer entitlement that another system has already acted on. A configuration rollback is one step in incident response, not a general undo operation.

AWS AppConfig documents reverting configurations and using alarms for automatic rollback during deployment. These mechanisms can limit exposure to a bad configuration. They do not remove the need to identify and repair effects produced before the rollback reached the relevant readers.

RecordWhy it matters after a configuration incident
Published configuration versionReconstructs the rule set available to readers
Reader’s loaded version and load timeShows distribution and freshness
Version used for a business decisionConnects an outcome to its actual rule set
External operation identifierSupports reconciliation and targeted repair
Activation and rollback eventsEstablishes the intended rollout timeline

Retries need continuity too. A payment that times out may have succeeded at the provider. Reselecting a provider under a newer rule before reconciling the original attempt can create a duplicate operation. Preserve the original attempt’s identity and routing context, and use the provider’s supported reconciliation or idempotency mechanism.

This is the same distinction between computation and committed effects that appears in agent transaction boundaries. Restoring the input that governs future work does not restore every system affected by earlier work.

Design the Outage Behaviour Before It Is Needed

When a reader cannot reach the configuration store, there are several possible policies: use a known version for a limited period, apply a specifically approved default, or stop the affected operation. The choice depends on the consequence of using stale or incomplete rules. It should be defined per operation rather than emerging accidentally from exception handling.

At startup, an instance may have no known version at all. Treat that differently from a healthy instance briefly unable to refresh. A default built into the executable needs compatibility with the deployed release and should be visible in telemetry when used.

The distribution path also needs recovery from a missed update. A reader can compare its loaded identifier with the intended version and reload a complete snapshot. Avoid treating an uninterrupted event stream as the only way to reconstruct configuration state unless its retention and recovery guarantees genuinely support that requirement.

Separate permission to author a change from permission to activate a consequential policy where the risk warrants it. Protect the distribution credentials and audit access, because modifying the configuration can modify production behaviour. The relevant security boundary extends beyond the application deployment pipeline.

Evaluate the Behaviour Seen by Users

A configuration dashboard should show the intended version and the versions actually in use. An activation timestamp alone cannot establish that readers loaded the update. For gradual changes, correlate business outcomes with the evaluated version and targeting context, while keeping telemetry proportionate to its purpose.

AWS AppConfig deployment strategies provide an example of controlled exposure and monitoring periods. The application still needs useful signals: provider errors, unacceptable routing, latency, or another measure tied to the change. A rollout can complete technically while producing the wrong business outcome.

Database-backed configuration is valuable when a real need exists to change behaviour independently of an application release. Its ongoing cost includes validation, distribution, compatibility, and repair. Treating those responsibilities as part of the application gives the team a clearer basis for deciding which rules should become dynamic and which can remain simpler deployment settings.