Database Load Simulation
Use this when you want to observe app behavior under sustained DB pressure before committing to integration tests or staging runs.
FlowLayer brings up the data stack and the load-generating services from one config, with explicit ordering so the pressure starts only after the API and database are ready.
Server config for DB load simulation
Section titled “Server config for DB load simulation”{ "session": { "bind": "127.0.0.1:6999", "token": "dev-token-db-load" }, "services": { "postgres": { "cmd": ["postgres", "-D", "./var/postgres"], "port": 5432, "ready": { "type": "tcp" } }, "redis": { "cmd": ["redis-server", "./infra/redis.conf"], "port": 6379, "ready": { "type": "tcp" } }, "api": { "cmd": ["pnpm", "--dir", "services/api", "dev"], "dependsOn": ["postgres", "redis"], "port": 3000, "ready": { "type": "http", "url": "http://127.0.0.1:3000/health" } }, "worker": { "cmd": ["pnpm", "--dir", "services/worker", "dev"], "dependsOn": ["api", "postgres", "redis"] }, "load-generator": { "kind": "oneshot", "cmd": [ "sh", "-c", "for i in $(seq 1 400); do curl -sS -X POST http://127.0.0.1:3000/orders -H 'content-type: application/json' -d '{\"customerId\":\"dev\",\"amount\":42}'; done" ], "dependsOn": ["api"] } }}Run and inspect
Section titled “Run and inspect”flowlayer-server -c ./flowlayer.jsoncflowlayer-client-tui -addr 127.0.0.1:6999 -token dev-token-db-loadWhat to watch:
- API logs for request bursts and failures
- worker logs for queue or retry behavior
- service status transitions when dependencies restart
Remote execution variant
Section titled “Remote execution variant”For heavier runs, execute the server on a VM or shared machine and connect from your laptop:
flowlayer-client-tui -addr 10.42.0.50:6999 -token dev-token-db-loadIf possible, prefer VPN or SSH tunnel access over direct exposure.
Safety precautions
Section titled “Safety precautions”- Use dedicated development data stores and credentials.
- Never point this pattern at production databases.
- Limit test volume to what your dev environment can handle.
- Rotate tokens when running on shared hosts.
Boundaries
Section titled “Boundaries”- This pattern simulates runtime behavior for development.
- FlowLayer is not a load-testing platform and not a production orchestrator.
- It does not replace Kubernetes, Docker Compose, PM2, or systemd.