UAE · ENBook a demo
RetailEngineeringDecision-maker

Database Agent

Manages schemas, migrations and query performance.

Database AgentApplication Engineering
Industry
Retail
Department
Engineering
Team
Application Engineering
Kind
Decision-maker
Approver
Engineering Manager
Code
ENG-07

It manages the schemas, migrations and query performance of the order, stock, product and loyalty databases, and decides how and when a migration runs so trading is never interrupted. It plans each migration with a rollback and a window outside peak trading hours.

How it works

7 steps, and a person signs off before step 7.

  1. 01Looks it up

    Finds the record the request is about in the database monitoring: the schema, table sizes, slow query log and backup state for the database named..

  2. 02Reads the request

    Works out what is being asked and what a complete answer needs.

  3. 03Checks the facts

    Checks figures, dates and rules against the source records, not from memory.

  4. 04Forecasts, when it decides

    Projects what each option will cost or return before it recommends one.

  5. 05Works it through

    Prepares the draft, match, recommendation or reply, with its sources.

  6. 06Asks a person

    Hands the work to Engineering Manager with its reasoning before anything goes out.

  7. 07Acts

    Once approved, it acts in the CI/CD pipeline: it schedules the migration job in the window with its rollback. and records what was done.

What it works with

Your knowledge, your systems, your people.

Knows

The database runbook: the schemas and owners, the migration patterns (expand and contract, online index builds), the trading-hours windows by region, the backup state and the data retention rules for shopper data.

Reads from

the database monitoring: the schema, table sizes, slow query log and backup state for the database named.

Acts in

the CI/CD pipeline: it schedules the migration job in the window with its rollback.

Hands back

An object with steps (a list of step, sql_summary, expected_lock_seconds and run_at), rollback (a list of steps), backup_ref, window, risk and query_changes (a list of query, before_ms and after_ms).

Asks a person when

The change drops or rewrites columns, purges shopper data, or must run outside 02:00-05:00.

ApproverEngineering Manager

Settings

Your limits, set by your managers.

SettingDefaultWhat it controls
Maintenance window (local time)02:00-05:00Locking or heavy migrations run only in this window.
Longest table lock allowed (seconds)2A migration that would lock a table longer must be done online or in steps.
Slow query threshold (ms)200Queries slower than this are candidates for tuning.
No migrations in peak tradingOnWhen on, no schema migration runs during the peak trading freeze.

Limits are settings, not code: a manager changes them without a developer.

Rules it always follows

  • Use expand-and-contract for column changes so old and new code both work during the release.
  • A migration that would lock a table for more than 2 seconds runs online or in batches, inside 02:00-05:00.
  • When on is true, no migration runs during the peak trading freeze.
  • Every migration has a tested rollback and a fresh backup before it starts.
  • Retention purges of shopper data follow the retention schedule and never touch orders inside the returns or warranty period.
  • Tune queries slower than 200 ms that run in checkout, availability or till lookups first.

See the Database Agent agent on your own work.

We’ll run it on a sample of your work and show you what your approver would see.

Database Agent · Retail | Basinwright Industries