Building safer DynamoDB workflows with Tables by Serverless Creed

Production database changes are rarely as simple as updating a record or deleting an outdated item. A small mistake in a filter expression, an incorrect environment selection, or an unintended bulk update can affect application availability and data integrity.

The challenge is not just making database changes easier. It is making them deliberate, controlled, and traceable.

During my testing of Tables by Serverless Creed, I explored how production safety workflows can reduce the risks associated with DynamoDB operations. This included read-only environments, controlled unlocking, dry-run validation, approval workflows, audit logging, and atomic transaction recovery.

1. Why production changes need a two-person rule

The two-person rule is a governance practice in which one person prepares a sensitive change and another independently reviews and authorizes it.

Instead of allowing a single operator to initiate and immediately execute a production mutation, this approach separates preparation from authorization.

A safer production workflow should include:

  • Read only access by default.
  • Explicit confirmation before enabling writes.
  • A dry run to understand the scope of a change.
  • Independent approval for sensitive operations.
  • Verification and audit evidence after execution.

These controls help prevent accidental modifications while making database operations more accountable.

2. Keeping production read-only by default

Production safety begins before a write operation is initiated.

In Tables, protected production environments can restrict write access through a read only state. Operators can inspect data and understand the current database state without immediately enabling modifications.

During scenario TC-GOV-002, I tested this protection by attempting to perform changes while the environment was locked.

The read only restriction provided an additional safety boundary between inspecting production data and modifying it.

Figure 1: Read only protection provides a safety boundary for production operations.

This distinction is particularly useful when developers switch between development and production environments throughout their daily work.

3. Unlocking production deliberately

When a production change is necessary, unlocking write access should be an intentional action rather than an accidental interaction.

I tested the unlock confirmation workflow by providing an incorrect confirmation before proceeding with the required confirmation.

The incorrect confirmation was rejected, preventing the unlock from completing.

Figure 2: Incorrect confirmation prevents the protected environment from being unlocked.

After providing the required confirmation, the environment could be unlocked for the intended operation.

Figure 3: Explicit confirmation enables temporary write access.

Temporary access is important because production environments should not remain writable indefinitely after maintenance is complete.

The auto relock behavior tested in Tables restored the protected state, reducing the risk of leaving production access open unnecessarily.

Figure 4: The environment returns to its protected state.

4. Dry-run before making changes

Unlocking an environment does not mean every subsequent operation is safe.

Consider a bulk update intended to modify one specific record. An incorrect filter could unintentionally target several records instead.

A dry run helps identify the intended scope before the actual mutation takes place.

During my testing, I used a controlled dataset containing four items and prepared a bulk update targeting a specific record.

The dry run identified one matching item out of four.

Validation Result
Total items in the test dataset 4
Items matching the intended change 1
Items outside the intended scope 3
Execution stage Preview before mutation

Figure 5: Dry-run validation identifies the intended scope before execution.

This provides an opportunity to review the selection criteria and detect unexpected matches before committing a change.

A dry run is not a guarantee that every subsequent write will succeed. Data can change between preview and execution, which is why execution-time validation and conditional writes remain important.

5. Adding an approval checkpoint

After reviewing the proposed operation, the next step is authorization.

Tables provides a Change Safety Review workflow that allows operators to examine a proposed mutation before proceeding.

An approval checkpoint creates an opportunity to consider:

  • Which resources will be affected?
  • Is the operation targeting the correct environment?
  • Does the proposed change match the intended scope?
  • What recovery options are available?
  • Is the change justified?

Figure 6: Reviewing a proposed database mutation before execution.

However, an approval dialog alone is not equivalent to a fully enforced two-person rule.

During TC-GOV-002, testing identified gaps in role-based authorization and independent approval enforcement. The tested workflow did not consistently require a second distinct approver, and these findings were raised for development review.

The distinction matters: an explicit approval checkpoint improves operational awareness, while a fully enforced two-person rule requires verified identity separation and independent authorization.

6. When a database change fails: atomic transaction recovery

Even with careful preparation and approval, database operations can fail during execution.

To explore this behavior, I tested a separate scenario, TC-ADV-003, using the Transaction Builder in Tables.

The objective was to determine whether a failed condition in a DynamoDB transaction would prevent an associated update from being committed.

The test used a disposable DynamoDB table named TC-ADV-003-Test in the Mumbai Region (ap-south-1).

Preparing the transaction

The transaction contained two operations:

Operation 1 — Update an existing order

The order was identified by:

  • Partition key: CUSTOMER#001
  • Sort key: ORDER#001

The intended update was to change the order status from PENDING to PROCESSING.

Figure 7: Configuring the order status update in Transaction Builder.

Operation 2 — Validate a customer record

The second operation checked whether the following customer profile existed:

  • Partition key: CUSTOMER#999
  • Sort key: PROFILE

The condition expression was:

attribute_exists(PK)

The customer profile was intentionally absent, creating a controlled failure condition.

Figure 8: Two operations configured as a single atomic transaction.

Although both operations were structurally valid, the second operation was expected to fail when evaluated against the actual database state.

Observing the transaction failure

When the transaction was executed, DynamoDB rejected the condition check.

Tables displayed the result through its Transaction Failure Analyzer:

  • Transaction cancelled.
  • One of two operations failed.
  • Error: ConditionalCheckFailed.
  • The update operation was marked as rolled back.
  • No writes were committed.

Figure 9: Transaction Failure Analyzer identifies the failed condition and reports that no writes were committed.

This demonstrates why atomic transactions are valuable when multiple database operations depend on one another.

DynamoDB provides the underlying all-or-nothing transaction guarantee. Tables provides the interface for constructing the transaction, inspecting its failure, and understanding which operation prevented execution.

Correcting and retrying the transaction

The failing condition was corrected to reference an existing customer profile:

  • Partition key: CUSTOMER#001
  • Sort key: PROFILE

The transaction was then executed again.

This time, the Transaction Builder reported:

Transaction committed successfully — 4.00 capacity units.

Figure 10: The corrected two-operation transaction commits successfully.

Rather than applying individual changes manually after a failure, the corrected transaction could be submitted again as a single atomic request.

7. Maintaining an audit trail

A safe database operation should leave evidence of what happened, regardless of whether it succeeded or failed.

The Audit Log in Tables recorded both transaction attempts.

Transaction attempt Recorded outcome
Original transaction with failing condition FAILED
Corrected transaction SUCCESS

The audit interface also displayed information such as the operation type, resource, timestamp, environment, correlation ID, and chain hash.

Figure 11: The failed transaction is recorded in the Audit Log.

Figure 12: The successful transaction is recorded alongside the earlier failure.

This evidence helps operators investigate incidents and understand the sequence of database changes.

The tested audit entries identified the actor as local-user. While the operation history was available, this does not independently establish the identities of separate requesters and approvers.

Identity-aware auditing remains an important requirement for a complete two-person governance workflow.

8. Understanding what Tables and DynamoDB each provide

Production safety involves both application level controls and database-level guarantees.

Capability Responsible layer
Protected environment and read-only workflow Tables
Unlock confirmation and automatic relock Tables
Dry-run preview Tables
Change Safety Review Tables
Transaction construction and failure visualization Tables
Conditional expression evaluation Amazon DynamoDB
Atomic transaction execution Amazon DynamoDB
Hash-chained operation history Tables

These layers complement one another.

Tables helps operators prepare, review, and investigate changes, while DynamoDB enforces the underlying transaction and conditional write semantics.

Neither layer should be treated as a substitute for correctly configured AWS IAM permissions, independent authorization, and organizational production access policies.

9. Costs and operational considerations

The demonstrations were performed using disposable test tables rather than actual production workloads.

When applying similar workflows in real environments, teams should consider:

  • Dry-run scans and queries can consume DynamoDB read capacity.
  • Successful mutations consume write capacity.
  • DynamoDB transactional operations have additional capacity requirements compared with standard operations.
  • DynamoDB transactions support up to 100 distinct item actions and an aggregate transaction size of 4 MB.
  • Independent approval enforcement must be verified before relying on it as a production governance control.
  • Temporary test resources should be cleaned up after validation.

Production safety should reduce operational risk without introducing unnecessary resource consumption or uncontrolled access.

Conclusion

Safe production database operations are not achieved through a single confirmation button.

They require multiple layers of protection: restricted access, deliberate unlocking, scoped dry runs, meaningful authorization, atomic execution, and traceable outcomes.

My testing of Tables demonstrated how these controls can support a more structured approach to DynamoDB operations, while also highlighting areas where independent approval enforcement needs further development.

The transaction recovery exercise reinforced another important principle: when related database operations depend on one another, atomic execution can prevent inconsistent partial changes.

The goal is not simply to make production changes faster. It is to make every change intentional, reviewable, and accountable.

Unlock deliberately. Dry-run carefully. Approve responsibly. Execute atomically. Audit consistently.