Code is only one part
AI can draft endpoints, components, queries, API integrations and tests before a team finishes the first architecture sketch. It can turn an idea into a working prototype quickly. That changes delivery speed; it does not make the surrounding system disappear.
- Endpoints
- Components
- Queries
- API integrations
- Tests
- Prototypes
The tool does not automatically know the real traffic pattern, budget, legal constraints, availability target, data classification, acceptable data loss, critical dependencies, operational capacity or growth plan. Those facts decide whether generated code belongs in production.
Code is one part of the system. System design is the reasoning that determines how every part works together.
System design is the connective reasoning
System design is the work of turning requirements into components with clear responsibilities, data flows and boundaries. It decides how parts communicate, where data lives, which failures to expect, how the system is operated and how it can grow.
- Components
- Responsibilities
- Data flows
- Boundaries
- Integrations
- Storage
- Communication
- Expected failures
- Growth
- Operations
- UserStarts with a real need
- ApplicationCoordinates the experience
- APIApplies product rules
- DatabaseKeeps durable state
Read the first design from left to right: the user reaches an application, which calls an API that owns access to the database. Even this small path already contains contracts and failure points.
Simple can be enough
A client, a monolithic application and PostgreSQL can be an excellent architecture. It keeps the important path visible and gives a small team fewer moving parts to understand.
- ClientBrowser or mobile app
- Monolithic appInterface, API, and business rules
- PostgreSQLOne durable source of truth
Good system design also means knowing when not to add microservices, Kafka, Kubernetes, multiple queues, different databases or abstractions for problems that do not exist yet.
The best architecture is not the most complex one. It is the simplest design that meets today's requirements without blocking the next predictable evolution.
What changes as the system grows
Architecture should change when requirements change. More traffic may justify a CDN, horizontal application instances, cache and read replicas. Slow or failure-prone work may move to a queue. Files may leave the primary database for object storage.
An AI feature adds another set of boundaries: model latency, provider limits, untrusted output, context privacy, evaluation and cost. Explore the stages below; moving a component changes the drawing, not its responsibility.
Explore the architecture
Select a component to inspect the architecture in a stable vertical map.
Simple
A direct request path with few moving parts and a low operational cost.
Component relationships
Solid lines are synchronous; dashed lines are asynchronous.
- Client Web AppPage request · Synchronous flow
- Web App APIAPI request · Synchronous flow
- API DatabaseRead or write · Synchronous flow
Component responsibility
Select a component to inspect its responsibility.
Text alternative for the interactive architecture
The same evolution represented in the diagram, in reading order:
- 1Simple: Client → Web app → API → Database.
- 2Growing: Client → CDN → Load balancer → Application instances → Cache and primary database. The database feeds a read replica; the API also reaches object storage and a queue processed by workers.
- 3AI product: Client → CDN → Web app → API gateway → Authentication → Core API. The core path uses cache, primary database, read replica, object storage, queues and workers. AI requests go through an orchestrator, guardrails and a model provider, with vector search, provider fallback, evaluation, tracing, metrics and logs around the request.
Decisions AI does not make alone
A model can suggest patterns. Engineering still has to choose which trade-offs fit this product, this team and this moment.
- Trade-offsEvery choice exchanges simplicity, cost, performance, consistency or delivery speed for something else.
- BottlenecksCPU, memory, databases, networks, external services and queues reach different limits.
- Failure modesTimeouts, partial outages, duplicates, lost messages and infinite retries need deliberate handling.
- SecurityIdentity, authorization, secrets, sensitive data and trust boundaries are architecture concerns.
- CostA technically elegant design can still be financially wrong for the product.
- ObservabilityWithout metrics, logs and traces, the team cannot see how the system behaves in reality.
- EvolutionThe design must absorb change without turning every new phase into a rewrite.
The new risk of AI-assisted programming
AI can accelerate sound implementations and weak decisions alike. A generated feature can pass a happy-path demo while hiding assumptions that only surface under load, failure or an incident.
The problem is not using AI. It is mistaking generated completeness for production readiness. The same applies to splitting a product into microservices before the team can deploy, observe and operate them independently.
| Looks like it works | Ready for production |
|---|---|
| Looks like it worksA cache makes the endpoint faster. | Ready for productionThe cache has ownership, invalidation rules, TTLs and a safe fallback when it is unavailable. |
| Looks like it worksRetries hide transient errors. | Ready for productionRetries are bounded, use backoff and operate on idempotent actions. |
| Looks like it worksA queue moves work off the request. | Ready for productionConsumers handle duplicates, poison messages, retry limits and a dead-letter queue. |
| Looks like it worksMore logs make debugging easier. | Ready for productionLogs are structured and useful without exposing secrets or sensitive customer data. |
| Looks like it worksThe model returns a good answer. | Ready for productionCalls have timeouts, cost limits, evaluation, guardrails and a fallback when a provider fails. |
| Looks like it worksEmbeddings improve retrieval. | Ready for productionSource data, vectors and retention follow privacy, access and deletion policies. |
| Looks like it worksGenerated endpoints check a user session. | Ready for productionAuthorization is consistent, centralized where useful and covered by negative tests. |
An AI architecture is still software architecture
The model may be the most visible part of an AI product, but it is still one component. A reliable request travels through authentication, authorization, context assembly, guardrails and orchestration before it reaches a provider.
- User
- Application
- API
- AI Orchestrator
- Guardrails
- Model
- Response
Supporting systems
- Cache
- Vector DB
- Tools
- Queue
- Evaluation
- Observability
Vector search, cache and tools support the main path; queues move slow work out of the request; evaluation, traces, metrics and logs show whether the result was useful, safe, fast and affordable. These branches are part of the product, not optional decoration around the model.
Authentication, context, authorization, latency, cost, fallback, evaluation and observability determine whether an AI feature works reliably.
Text path: User → Application → API → AI orchestrator → Guardrails → Model → Response. The orchestrator can also reach a vector database, cache and tools; asynchronous work uses a queue; evaluation and observability inspect the result.
How to start studying system design
Start with a small system and make every decision answer a requirement. A useful practice loop is:
- 1Start with functional and non-functional requirements.
- 2Draw the main user and data flow.
- 3Identify data and trust boundaries.
- 4Estimate scale and access patterns.
- 5Map bottlenecks and failure modes.
- 6Choose the simplest architecture that fits.
- 7Define how the system will be observed.
- 8Plan the next evolution, not every possible future.
You do not need to memorize the architectures of large companies. Learn to explain what a decision protects, what it costs and which evidence would make you change it.
The responsibility stays with engineering
In the age of AI, producing code is more accessible. That increases the value of engineers who can turn incomplete requirements into systems that remain secure, reliable and sustainable after the prototype works.
AI helps build components. System design helps build products that keep working when they meet users, failures, costs and the real world.