One Postgres, a database per user, or both?
Choosing between one Postgres database, a Turso database per user, or both comes down to where data must live, who owns it, and how many features need to read across users.
Topics Architecture & design
End-to-end design of a system and its tradeoffs.
Search within System design, or combine it with other topics →
Choosing between one Postgres database, a Turso database per user, or both comes down to where data must live, who owns it, and how many features need to read across users.
Grab built an offline ads simulator that sequentially replays historical ad opportunities, applies candidate bidding, ranking and pacing logic, and probabilistically generates user responses from calibrated engagement models.
Booking.com’s search engine generates personalised hotel offers at request time instead of precomputing and indexing every possible room/date/price combination, which would be combinatorially infeasible.
Fly.io replaced HashiCorp Vault with Petsem, a home-grown secrets store that keeps a single write master in IAD but adds regional read replicas, trading strict consistency for availability.
OpenAI's Performance Factory is a cloud-based system of Codex agents that automates performance regression handling end to end, from alert to root cause, proposed fix, and verified recovery.
Datadog's Semantic Core is a knowledge graph that encodes equivalences between Datadog-native and OpenTelemetry metrics and span attributes, including deprecation chains across OTel convention versions.
Grab's merchant data service suffered a cascading failure when cache read timeouts fell back to the database, retries piled on, and availability collapsed.
Netflix's AI Discover tab on TV is driven by an "intelligence layer" agent harness.
Pinterest rebuilt Guardian, its real-time abuse detection platform, from a monolithic in-house system into a modular V2 that separates interactive analytics, continuous action evaluation and historical replay.
Cloudflare Spend Management, now in beta for pay-as-you-go customers, lets users set spending limits and alert thresholds on Workers and Durable Objects, automatically pausing billable invocations when a cap is hit.
Fly.io rebuilt 6PN, its private IPv6 network between Fly Machines, replacing a fleet-wide eBPF map of every migrated Machine's location (hundreds of thousands of entries kept in sync from Corrosion's gossip-replicated SQLite) with lazy, on-demand routes.
A reference architecture for enterprise AI agents on AWS organizes the system into five layers: an API gateway enforcing identity and policy, a five-phase agent runtime (Understand, Plan, Retrieve, Reason, Act and Observe), a knowledge and state tier, platform services for models and tools, and a cross-cutting trust and control framework.
Zillow replaced more than 10 per-campaign notification generator services with a configuration-driven Campaign Orchestrator that runs each of 100M+ daily email and push notifications as a short-lived AWS Step Functions Express Workflow, calling a shared library of stateless, schema-driven content modules (the Universal Content Generator) via HTTP Invoke.
Lyft built a Fake Payment Provider that implements the same provider interface as real processors (tokenize, authorize, increment, capture, charge, refund, void), so it can simulate partial failures, soft declines with retries, pending responses, timeouts and outages that processor test cards cannot.
Facebook's Your algorithm feature lets people edit, in natural language, the "Interested In" and "Not Interested In" lists that steer Feed and Reels ranking, backed by a single shared preference store.
Application teams in regulated enterprises can run self-service multi-Region failover behind a centralized ingress proxy fleet by owning a Route 53 Private Hosted Zone failover recordset while a central team owns peered Transit Gateways and VPC attachments.
Stripe's company-wide productivity agent Kai was built by one engineer in a week on LangChain's open-source Deep Agents harness.
Netflix replaced its synopsis fact-checker, which made five long-context (100k+ token) reasoning-model calls per synopsis, with a cascade.
Dropbox's file-acting agent grew out of two engineer prototypes, a server-side sandbox with installed software and a desktop chat UI with permission controls, merged into one system.
Nimbus is Figma's internal platform for running tens of thousands of sandboxes for AI-generated code across multiple cloud providers.
Before adding a sync engine or local data copy to speed up an application, check whether the real bottleneck is network-attached storage under managed Postgres.
Wise built a system that automatically reroutes EUR bank pay-ins to an alternative vendor, per bank, when the primary vendor fails or degrades.
Sauna, a proactive AI work assistant, gives every session, agent and connected inbox or calendar its own Turso database, creating about 90,000 databases a day and over 2 million in total.
Turso Cloud's paid plans no longer meter active databases, so a database costs only its storage while idle.
Tangled is a federated code forge built on the AT Protocol: self-host Git hosting (knots), CI runners (spindles), or the whole API and UI, and still collaborate with everyone else.
LangChain's Paid Media Agent is a Slack-resident Deep Agent that merges ad-platform data with warehouse pipeline data, produces weekly per-platform PDF reports, answers follow-up questions, and proposes campaign changes for human approval.
PrivacyLib is a common library embedded in the clients of hundreds of Meta data and processing systems that enforces and observes privacy requirements at the point of data access.
Stripe Data Pipeline's real-time sync streams Stripe objects into Postgres tables within seconds, which lets apps drop webhooks entirely: they write to Stripe's API and read charges, prices and promotion codes from synced stripe.* tables.
Neki's shard groups co-locate related Postgres tables by hashing a shared shard key (e.g. customer_id via xxhash) into a 64-bit keyspace split across shards, so joins and transactions for one customer stay on a single shard with full Postgres semantics.
An atmospheric group, as defined by the community opensocial.group proposal, is its own atproto DID that owns a set of permissioned spaces.
ChatGPT's ad stack replaces the event-driven request/response ads pipeline with stateful ads sessions that track evolving intent across turns and conversations, orchestrated by a post-trained LLM that calls tools for query rewriting, ANN retrieval over multiple embedding indices, eligibility filtering (budget, pacing, targeting, policy, dedup), relevance and engagement scoring, and a separate auction tool that handles pricing and final selection.
Modal's Sticky Sessions pin every request in a session to the same serverless container, which suits stateful workloads like streaming speech-to-text, voice agents, shared rooms and multiplayer games without resorting to max_containers=1.
Meta replaced a single all-knowing AI agent for onboarding data columns across its recommendation pipelines with a deliberately thin, deterministic orchestrator: about 1,300 lines that route 20+ workflows to 14 specialized subagents and do no domain reasoning.
Netflix built the Observability Ontology, an RDF/OWL knowledge graph that gives a shared, machine-readable model of applications, incidents, deployments and alerts that tools like Atlas, Radar, Spinnaker, PagerDuty, incident.io and Slack each describe differently.
Evergreen is a Go-based GitHub App that automates quarterly outside-collaborator access reviews and stale-repo archival in a shared org of 1,400+ GitHub employees, customers and partners, built entirely from native primitives: scheduled Actions firing repository_dispatch, webhooks, issue checklists, custom properties, and per-repo JSON state files in git that double as the audit trail.
Netflix adopted DataJunction (DJ), an open-source semantic layer, to centralize metric and dimension definitions after onboarding a single metric to its experimentation platform took weeks.
Atproto spaces, a permissioned-data extension to the AT Protocol, is nearing launch with its core primitives stabilizing, and the team will publish weekly code samples until release.
Shared schema with row-level security, schema per tenant, and database per tenant trade off isolation strength against operational cost.
Anthropic replaced git with Scion, an in-house centralized version control system, after its monorepo grew past what git mirrors could serve.
Flex Model is Jane Street's OCaml framework that turns market events into feature vectors for neural-network trading models, replacing a 17k-line monolith where adding one feature touched nineteen files.
An AI agent's retrospective on designing cross-component-boundary binding (DL#193) for Wix's Jay web framework shows a recurring failure: first drafts added unneeded machinery and made claims about runtime behavior that tracing disproved.
Middleware should manage workflows rather than applications: the three-tier app server, which replaced two-tier client-DBMS setups in the 1990s to fix connection and memory limits, should evolve into a workflow orchestrator.
Wix replaced a fixed merchant dashboard with an agent-orchestrated interface: the agent picks which approved, frontend-registered React components to show (in-chat widgets and main-area page previews) and with what props, while the frontend owns the component catalog.
Grab built sim-rs, a self-contained tick-based marketplace simulator that replays a city-day of bookings and drivers through a closed dispatch loop (demand, supply movement, cancellation models, batching, solver-based allocation, recycling) in tens of minutes, with pluggable stages, portable reproducible run packages, and built-in switchback/spatial A/B/n experiments.
Google's next-generation Federated Learning system runs training inside Trusted Execution Environments (TEEs) so that privacy guarantees can be verified externally rather than taken on trust.
Reclaim added natural-language AI scheduling by routing agent requests through the same scheduling logic used by users and its automated scheduler, rather than building a separate AI-only path.
Grab generates consumer-facing merchant review summaries with a pipeline that stratifies review samples by a sentiment-scored rating distribution, uses an LLM to produce overall and topic-based summaries (taste, packaging, portion size), and has a separate LLM check each claim against the sampled reviews before publication.
Zalando open-sourced the MIT-licensed Agentic Identity Broker, which lets AI agents act on behalf of users across third-party systems without ever receiving provider tokens.
Meta's Private Processing extends the AI glasses trust boundary into the cloud by running models inside confidential VMs on TEE-capable CPUs and GPUs, so host OS, hypervisor and Meta operators see only ciphertext.
Neki shards unmodified PostgreSQL behind a single connection string.
Included Health's Dot healthcare guide runs on a federated LangGraph "supergraph" in which a conversational router hands off to team-owned sub-workflows for urgent care, scheduling, specialists and behavioral health.
Enterprise agent programs in Europe and the Middle East are shifting from standalone chatbots to central platforms that consolidate scattered proofs of concept, with observability, evals and cost control as the foundation for scale.
LuBot, a solo-founder analytics chat product, gives each paying customer an isolated Postgres database by creating a Neon branch from a Stripe webhook, with Supabase kept as the control plane for orgs, users and billing.
Lyft rebuilt its Neighborhood Reachability Signals, precomputed geohash-6 travel-time matrices that define the graph its pricing engine optimizes over.
Meta built a domain-expert AI agent for a compliance domain that separates declarative knowledge files (positions, taxonomies, routing indexes, gateway tests with YAML dependency graphs) from imperative composable "recipes" that encode expert reasoning workflows.
In a two-sided retail media marketplace, A/B test variants that draw from shared advertiser budgets violate SUTVA, because a more efficient treatment drains the budget and depresses control metrics (cannibalization bias).
QuintoAndar's customer data platform replaced a Lambda architecture (a Postgres hot layer plus Kafka Connect into a Delta landing zone processed by 24/7 Databricks jobs with costly MERGE INTO deduplication) by having its event gateway write about 900 million monthly events directly into ClickHouse Cloud, which also serves roughly 300 million API requests a month with sub-second reads.
Wix Orchestrator turns user support tickets into reviewed pull requests in hours instead of weeks.
The standard warning against database-per-tenant assumes each database is a server process like PostgreSQL or MySQL, with its own memory, connection pool and backup schedule.
Airbnb rebuilt login and signup around an "Identify first then Challenge" model.
Linear Agent is constrained by boundaries rather than scripted paths: a fundamentals-focused system prompt, tools designed so invalid actions are impractical, and an explicit model of Linear's product concepts.
Document ingestion for agents breaks because PDFs carry no structural markup, so naive text extraction scrambles multi-column layouts and tables, and frontier models lose accuracy on visual structure while returning flat text with no bounding boxes, confidence or provenance.
Modal rebuilt its serverless I/O plane, which queues Function inputs and outputs, and now runs it in at least four regions.
GPT-Live replaces turn-detector-based voice AI with a full-duplex voice model that listens and speaks simultaneously, delegating deeper reasoning and tool use to frontier models like GPT-5.5 over an asynchronous RPC path that never blocks media.
Agents are long-running, stateful and non-deterministic, so running them inside an HTTP request handler breaks in production.
Blender 5.2 LTS adds Remote Asset Libraries, which list assets hosted on remote servers and download them on demand, so the Essentials library can grow with online base meshes, materials and HDRIs without increasing download size.
Canva moved its gateway session-revocation cache from per-pod MySQL loads to sorted binary chunks in S3, eliminating the database stampede when hundreds of gateway pods started during deploys.
Riviera, Dropbox's content processing platform, grew from an internal file-preview service into shared infrastructure behind Search, Replay, Sign and Dash.
Shipyard is Slack's EC2 platform that replaces continuously Chef-converged, long-lived instances with immutable, layered AMIs deployed through progressive, metric-gated rollouts.
Bobbin is a read-only, API-only AppView for Tangled that serves the sh.tangled.* atproto lexicons over XRPC while holding everything in RAM.
Modal is best understood not as a neocloud or inference provider but as a computer: a virtual machine built across dozens of cloud providers, mapped component by component onto a classic computer architecture.
Meta rebuilt its BLOB-storage stack on top of the Tectonic block layer to stop storage from stalling GPUs in AI training.
Datadog measures ingestion data completeness per customer by splitting pipelines into segments and recording create and acknowledgment events keyed by unique payload IDs in 60-second time buckets.
Clever replaced a split Datadog/Athena logging setup with ClickHouse Cloud.
Meta classifies data assets for privacy enforcement with a hybrid pipeline: it builds structured evidence briefs from code resolution, lineage, ownership and annotations, uses LLMs only for novel or ambiguous assets, and distills stable patterns into versioned, human-reviewed deterministic rules.
Alien's pull-mode BYOC operator, which runs inside customer cloud accounts and must survive restarts, network loss and half-applied deployments, replaced hand-rolled JSON state files with an embedded, encrypted Turso database.
Network throughput on Oxide's rack is shaped by several layers: frame size, offloads, CPU placement, flow parallelism and protocol, and each fix exposes the next bottleneck.
Production agents depend more on system design than on model capability: use deterministic automation for predictable workflows and reserve agents for steps that need judgment over messy context.
Quick is Shopify's internal static hosting platform: each site is a folder in a Google Cloud Storage bucket, mounted via gcsfuse and served by a wildcard NGINX config behind Identity-Aware Proxy, with `quick deploy` wrapping gcloud rsync.
Palantir's Gotham document store rebuilds Elasticsearch indices from its transactional database (the source of truth) rather than using Elasticsearch's _reindex API, so search keeps serving live traffic throughout.
Real-time analytics means low-latency queries over continuously changing data, so it is a system property spanning time to ingest, time to transform and prepare, and time to query, not just query speed.
Shopify's Slack-native agent River co-authors one in eight merged PRs, and it rests on two 2024 bets: a single monorepo (World) and Nix-built reproducible environments across dev, CI and production.
Neon (and Databricks Lakebase) hardens its serverless Postgres against cloud failures by keeping Postgres compute stateless over zone-redundant storage, so failed computes are replaced instantly without hot standbys or WAL replay.
Yelp replaced a menu-tree and fixed-phrase customer support chatbot with an LLM system.
Real BYOC (Bring Your Own Cloud) splits a managed platform into a vendor-hosted control plane, which holds only infrastructure metadata, and a data plane in the customer's own cloud account.
"Multi-region" covers three distinct problems: CDN static asset distribution (level 1), stateless compute in multiple regions with a single-region database (level 2), and multi-region writes for stateful data (level 3).
Deploying AI apps splits into two distinct problems: Layer 1 model serving (GPU scheduling, weight loading, per-token economics) and Layer 2 AI apps (long-running web services, workers, Postgres/pgvector, crons, streaming) that call hosted model APIs.
Instacart extended its Marketplace marketing automation to 350+ Storefront Pro white-label retailers by giving each retailer its own isolated workspace in a third-party provider, fronted by Instacart-built React tooling.
The WASI 0.3 `wasi:http` middleware world (import handler, export handler) shows how Wasm component composition enables in-process service chaining and, more generally, interposition: inserting a component between any caller and callee without modifying either.
A reference architecture for scalable document processing splits a monolithic upload-and-parse server into a thin web service, a Render Workflows orchestration layer, and a Postgres store.
Wealthfront executes trades with brokers through a four-layer stack: dedicated network links with one persistent TCP socket per broker session, the FIX 4.2 Tag=Value protocol, a customized fork of the QuickFIX/J engine, and an internal translation layer.
Vinted's autocomplete service runs on Vespa and serves 4,700 queries per second at 31 ms P99 over a pool of 125 million suggestions across 50+ country-language markets.
Slack's multi-agent security investigation service keeps long-running agent teams coherent through three context channels rather than accumulating full message history.
Claude Managed Agents splits a long-running agent into three virtualized interfaces: an append-only session log, a stateless harness that calls Claude and routes tool calls, and sandboxes reached through a generic `execute(name, input) → string` tool call.
Cynical Sally, an AI roast-reviewer, runs nine clients (website, browser extensions, CLI, MCP server, open-source Lite version and upcoming apps) as thin layers over a single Render-hosted backend.
trivago built an internal GraphQL gateway on GraphQL Mesh v0, embedded in a Node.js Express server, that stitches more than 15 upstream sources (OpenAPI services, MySQL databases, GraphQL servers) into one graph powering a unified admin tool.