Skip to content

ateapi: add persistence compat with MySQL/Vitess in addition to Postgres - #2163

Closed
Ricardo Nunez (ricardonunez-io) wants to merge 44 commits into
agent-substrate:mainfrom
antinuous:mysql-compatibility
Closed

Ricardo Nunez (ricardonunez-io) wants to merge 44 commits into
agent-substrate:mainfrom
antinuous:mysql-compatibility

Conversation

@ricardonunez-io

@ricardonunez-io Ricardo Nunez (ricardonunez-io) commented Oct 3, 2026 •

Copy link
Copy Markdown

Set ATE_API_STORE_BACKEND=mysql (or --store-backend=mysql) to use MySQL 8.0 or later. The new atemy store uses only features that PlanetScale's Vitess supports as a subset of MySQL, meaning all MySQL 8.x+ deployments, Vitess deployments, or PlanetScale deployments are now supported.

PostgreSQL stays the default.

  • Store. atemy implements the same store interface as atepg, with its own migrations. Shared code (page tokens, leases, the migration runner, worker events) moved into storesql. Tests that covered both backends moved into storecontract.
  • OpenFGA. Both backends use one transactional OpenFGA datastore. Access policy members are capped at 256 characters on MySQL to fit OpenFGA's tuple column. PostgreSQL keeps 512.
  • Outbox. Worker writes take an AUTO_INCREMENT seq, so they do not serialize on a counter row. The watch tracks seq gaps and probes stale ones to detect rolled-back writes.
  • Startup checks. ateapi refuses to start on MariaDB, MySQL older than 8.0, auto_increment_increment != 1, or a non-strict sql_mode.
  • Install. ate-setup, hack/install-ate.sh, and the ateapi manifest accept MySQL DSNs and TLS file paths. No MySQL server is bundled.
  • CI. The controlapi and workerservice suites run again with ATE_TEST_STORE_BACKEND=mysql. TestVitess runs atemy against vttestserver, and the step fails if that test does not run. hack/verify/mysql-migrations.sh keeps merged migrations immutable.

docs/mysql.md covers setup, TLS, pool sizing, PlanetScale limits, and behavior that differs from PostgreSQL. docs/dev/postgresql-schema-evolution.md is now docs/dev/schema-evolution.md and covers both backends.

Note

About 29.4k lines in this PR are third-party generated code: 16.2k in _LICENSES/ and 13.2k in vendor/.

Breaking changes

--postgres-pool-max-conns and ATE_API_POSTGRES_POOL_MAX_CONNS are replaced by --store-pool-max-conns and ATE_API_STORE_POOL_MAX_CONNS. The new setting applies to either backend. Deployments that set the old variable must rename it. Otherwise the pool falls back to the default size.

  • Tests pass
  • Appropriate changes to documentation are included in the PR

@ricardonunez-io Ricardo Nunez (ricardonunez-io) changed the title ateapi: add persistence compat with MySQL/Vitess in addition to PostgreSQL ateapi: add persistence compat with MySQL/Vitess in addition to Postgres Oct 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant