Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Wealthfront Engineering 7 min read Case study mediumAdept

How we standardized MariaDB in our Integration Server

Wealthfront replaced the embedded HSQLDB in its Integration Server, a self-contained production mirror used for integration tests, local end-to-end debugging and Jenkins gating, with MariaDB to match production. Parity catches missing indexes, strict numeric and string integrity issues, real locking and connection-pool behaviour, and optimizer plans that HSQLDB hid. MariaDB runs via Testcontainers wired into a Template Method base class that builds JDBC URLs from the container's mapped port. Jenkins agents that already run in Docker mount the host's docker.sock to start sibling containers instead of Docker-in-Docker, and a JVM-flag feature toggle allowed a branch-by-branch rollout.

Assumes: Docker basicsJDBC and HibernateIntegration testing in Java

Related posts

  • Model-Based Testing with Testcontainers and Jqwik

    Docker mediumAdept

    Model-based testing can regression-test a REST API by running the current version (Postgres-backed) and a candidate version (MySQL-backed) side by side, sending both identical randomly generated request sequences, and comparing their responses. Testcontainers' ComposeContainer starts both apps and their databases from a Docker Compose file. jqwik's Arbitraries and ActionSequence generate sequences of CRUD actions that assert matching status codes and bodies. In the demo, the generated tests quickly find a divergence on a department search with unusual Unicode input, traced to a Postgres-specific native SQL query.

  • Test Your Database Without Mocks

    Neon mediumAdept

    Database mocks are brittle, expensive to maintain, and test little beyond the mock itself, since they skip real behaviour like transactions, isolation levels, foreign keys and referential integrity. The usual reasons to mock, isolation and speed, are better served by copy-on-write database branches than by test containers, which bring resource overhead, port conflicts, cleanup and CI orchestration problems. Neon branches give each developer, test suite or pull request an isolated Postgres copy with real data, created via neonctl or a GitHub Action, optionally from a point in time for debugging. Shared storage and scale-to-zero compute keep the cost low.

  • Shift-Left Testing with Testcontainers: Catching Bugs Early with Local Integration Tests

    Docker mediumAdept

    Running integration tests locally against real dependencies via Testcontainers catches bugs that unit tests and mocks miss, before code reaches shared CI or staging environments. A worked TypeScript example shows a user-registration service that allows duplicate emails differing only in case, then compares four ways to catch it. Unit tests miss it, E2E tests catch it too late, mocks must duplicate the validation logic, and a PostgreSQL container test catches it in seconds. The post also estimates DORA-metric gains for the shift-left workflow, such as under 20 minutes versus roughly 2 hours to find and fix a bug, and pitches Testcontainers Cloud for CI and team-scale use.

  • Leveraging Testcontainers for Complex Integration Testing in Mattermost Plugins

    Docker mediumAdept

    Mattermost replaced brittle mock-based plugin tests with Testcontainers-driven integration tests that spin up a Mattermost server, PostgreSQL on an internal Docker network, and optional API mock containers. A custom Go module exposes helpers for plugin installation, DB access, the Go API client and admin operations, while Testcontainers for Node.js pairs with Playwright for UI-level tests. The approach is used for the AI Copilot plugin (mocked LLM API) and the MS Teams plugin (mocked Microsoft Graph), giving isolated, repeatable tests where teams choose per-test or shared container lifetimes.

  • Partitioning GitHub’s relational databases to handle scale

    GitHub Engineering mediumAdept

    GitHub split its monolithic `mysql1` MySQL cluster by first virtually partitioning tables into schema domains (declared in YAML) and enforcing boundaries with query and transaction linters, then physically moving domains to new clusters via Vitess vertical sharding or a custom ProxySQL/GTID-based write-cutover script. Cross-domain joins were eliminated with techniques like preload, Rails' new `disable_joins` option and application-side joins, validated with Scientist experiments. The write-cutover moved 130 of the busiest tables in tens of milliseconds with only a handful of failed writes. Query volume grew from 950k to 1.2M queries/s while average per-host load halved, reducing database-related incidents.

The quest for software engineering knowledge.

Look:
Layout: