Architecture
How the systems fit together
The diagrams we draw first when designing a system. Each one shows the layers or the flow, and the components that carry the load.
- Anatomy of a production AI application
- The AI engineering lifecycle
- Retrieval-augmented generation pipeline
- Agentic workflow with human approval
- Microservices architecture
- Event-driven architecture
- Frontend rendering strategies
- Mobile application backend
- Cloud platform architecture
- CI/CD pipeline with security gates
- Security architecture: defence in depth
- Web3 and digital asset infrastructure
- Modern data platform
- High-performance transaction platform
- Multi-tenant SaaS architecture
- Real-world asset tokenisation flow
These are generalised patterns. A real design starts from your requirements and constraints and usually departs from the pattern in at least one important way.
Anatomy of a production AI application
User
- Web app
- Mobile app
- Chat interface
- Internal tools
Application Layer
Owns identity, permissions and the user experience
- Session handling
- Access control
- Response streaming
- Feedback capture
AI Orchestration Layer
Where prompts, tools and policy are versioned and tested
- Prompt management
- Tool calling
- Guardrails
- Model routing
Models / Agents
- Hosted LLMs
- Self-hosted models
- Task agents
- Embedding models
Knowledge & Data Layer
Retrieval respects the caller's permissions
- Vector index
- Document store
- Relational data
- Semantic cache
Enterprise Systems / APIs
- ERP and CRM
- Identity provider
- Internal APIs
- Document repositories
Infrastructure & Observability
Traces, cost and quality measured per request
- Kubernetes
- GPU and API capacity
- Tracing and evaluation
- Cost monitoring
The AI engineering lifecycle
- 01
Data
Collect, clean, label and govern sources
- 02
Models
Select, adapt and version models
- 03
Orchestration
Prompts, retrieval, tools, guardrails
- 04
Applications
Product surfaces and system integration
- 05
Evaluation
Offline test sets and online review
- 06
Observability
Traces, cost, latency and drift signals
Retrieval-augmented generation pipeline
Ingestion
- 01
Sources
Documents, databases, internal APIs
- 02
Parse and chunk
Extract text, keep structure
- 03
Embed
Batch embeddings, versioned model
- 04
Index
Vector and keyword indexes with ACLs
Query
- 01
Question
Authenticated user and their scope
- 02
Retrieve
Hybrid vector and keyword search
- 03
Rerank
Keep only the strongest passages
- 04
Generate
Grounded answer with citations
- 05
Evaluate and log
Trace, score and capture feedback
Agentic workflow with human approval
Reason
- 01
Trigger
Event, schedule or user request
- 02
Plan
Break the goal into bounded steps
- 03
Tool calls
Read-only lookups via typed tools
- 04
Draft action
Proposed change with its evidence
Act under control
- 01
Policy check
Limits, permissions, risk rating
- 02
Human approval
Required for high-impact actions
- 03
Act
Idempotent write to target system
- 04
Verify
Confirm the result, retry or roll back
- 05
Audit
Every step logged and replayable
Microservices architecture
Clients
- Web app
- Mobile apps
- Partner integrations
API Gateway / BFF
- Routing
- Authentication
- Rate limiting
- Response shaping
Domain Services
Each service owns one bounded context
- Orders
- Payments
- Catalogue
- Accounts
- Notifications
Async Messaging
- Kafka topics
- Outbox publisher
- Event consumers
- Dead-letter queues
Data Stores
Database per service, no shared tables
- PostgreSQL per service
- Redis cache
- Search index
- Object storage
Platform
- Tracing and metrics
- Central logging
- CI/CD pipelines
- Service configuration
Event-driven architecture
Producers
- 01
Command
Service handles a request
- 02
Local transaction
State and outbox row commit together
- 03
Outbox relay
Polls or tails the log, then publishes
- 04
Publish
Keyed event with schema version
Broker
- 01
Topic
One per event type or aggregate
- 02
Partitions
Ordering holds per key
- 03
Retention
Replay from an earlier offset
- 04
Dead-letter queue
Holds events that keep failing
Consumers
- 01
Consumer group
Scales out across partitions
- 02
Idempotent handler
Dedupe on event ID before applying
- 03
Retry with backoff
For transient faults only
- 04
Commit offset
After the side effect succeeds
- 05
Project state
Update read models and caches
Frontend rendering strategies
Build time (SSG)
- 01
Content and data
CMS, Markdown or API read at build
- 02
Static generation
Pages rendered once to HTML
- 03
CDN
Cached and served from the edge
- 04
Revalidate
Regenerate on change or on a timer
Request time (SSR)
- 01
Request
Per-user or fresh data is needed
- 02
Server render
Fetch data, render components
- 03
Streaming
Send the shell, then slower parts
- 04
Hydration
Attach handlers in the browser
Client (SPA)
- 01
Client state
UI state and optimistic updates
- 02
API calls
Typed requests to the backend
- 03
Cache
Dedupe, revalidate, invalidate
- 04
Navigation
Client routing with prefetch
Mobile application backend
Mobile Apps
- iOS (Swift)
- Android (Kotlin)
- Flutter
- Offline store
Edge
- CDN
- API gateway
- Authentication
- Rate limiting
BFF / Mobile API
One round trip per screen where possible
- Screen-shaped responses
- API versioning
- Sync endpoints
- Feature flags
Services
- Accounts
- Content
- Payments
- Media processing
Data & Notifications
- PostgreSQL
- Redis
- Object storage
- APNs and FCM push
Observability
- Crash reporting
- API tracing
- Release health
- Client analytics
Cloud platform architecture
Edge
- DNS
- CDN
- WAF
- DDoS protection
Network
Workloads and data sit in private subnets
- VPC
- Public and private subnets
- Load balancers
- NAT and peering
Compute
- Kubernetes
- Containers
- Serverless functions
- Autoscaling
Data
- Managed databases
- Cache
- Object storage
- Message queues
Platform Services
- Secrets management
- IAM
- Infrastructure as code
- Container registry
Observability & DR
Restores are rehearsed, not assumed
- Metrics and logs
- Tracing
- Backups
- Multi-zone failover
CI/CD pipeline with security gates
Build & verify
- 01
Commit
Reviewed merge to the main branch
- 02
Build
Reproducible, pinned dependencies
- 03
Test
Unit, integration and contract tests
- 04
SAST and deps scan
Static analysis, dependency audit
- 05
Image scan and sign
Scan layers, sign, attach SBOM
Release
- 01
Staging
Same artefact, production-like data
- 02
Canary
Small traffic share, watch signals
- 03
Production
Progressive rollout with gates
- 04
Monitor
SLOs decide promote or roll back
Security architecture: defence in depth
Identity
Every request is authenticated and authorised
- SSO and MFA
- Role-based access
- Service identities
- Session policy
Edge
- WAF
- DDoS protection
- TLS termination
- Rate limiting
Application
- Input validation
- Authorisation checks
- Secure SDLC
- Dependency scanning
Data
- Encryption at rest
- Encryption in transit
- Key management
- Data classification
Infrastructure
- Network segmentation
- Hardened images
- Secrets management
- Patch management
Detection & Response
Assume a control will fail and plan for it
- Central audit logs
- Alerting rules
- Incident runbooks
- Forensic retention
Web3 and digital asset infrastructure
Applications & APIs
- Client applications
- API gateway
- Partner APIs
- Operations console
Wallets & Transactions
- Address management
- Transaction builder
- Nonce and fee control
- Policy engine
Key Management
Keys never leave the signing boundary
- HSM
- MPC signing
- Approval quorum
- Key rotation
Node / RPC Layer
- Full nodes
- RPC providers
- Failover routing
- Mempool access
Indexing & Analytics
Chain data is provisional until it is final
- Block ingestion
- Event decoding
- Reorg handling
- Query APIs
Monitoring & Compliance
- Transaction monitoring
- Address screening
- Audit trail
- Alerting
Modern data platform
Ingest and store
- 01
Sources
Databases, SaaS tools, events, files
- 02
Ingestion
Batch, CDC and streaming
- 03
Raw storage
Immutable landing zone
- 04
Lakehouse
Open table formats or a warehouse
- 05
Catalogue
Schemas, lineage and ownership
Transform and serve
- 01
Transform
Versioned, tested SQL models
- 02
Quality checks
Freshness, volume and schema tests
- 03
Serve BI
Dashboards and governed metrics
- 04
Serve APIs
Data products for applications
- 05
ML and embeddings
Features and vector indexes
- 06
Governance
Access policy, masking and audit
High-performance transaction platform
Channels
- Web
- Mobile
- Partner APIs
- Batch files
API Gateway
- Authentication
- Rate limiting
- Idempotency keys
- Request signing
Transaction Services
Java and Spring Boot, stateless, horizontally scaled
- Payment initiation
- Authorisation
- Ledger posting
- Limits and risk
Kafka Event Backbone
- Transaction events
- Outbox relay
- Partitioned topics
- Dead-letter topics
Ledger DB & Redis
The ledger is authoritative, the cache is not
- Double-entry ledger
- Read replicas
- Balance cache
- Distributed locks
Reconciliation & Audit
- Settlement matching
- Break detection
- Immutable audit log
- Reporting exports
Monitoring
- Latency and error SLOs
- Consumer lag
- Tracing
- Business alerts
Multi-tenant SaaS architecture
Tenant-aware Edge
- Custom domains
- Tenant resolution
- WAF
- Per-tenant rate limits
Identity & SSO
- SAML and OIDC
- SCIM provisioning
- Roles and permissions
- MFA
Control Plane
Manages tenants, never serves their traffic
- Tenant lifecycle
- Plans and entitlements
- Billing and metering
- Feature flags
Application Plane
- Stateless services
- Background jobs
- Tenant context
- Webhooks
Data Isolation
Isolation model chosen per plan tier
- Row-level security
- Schema per tenant
- Dedicated databases
- Per-tenant keys
Per-tenant Observability
- Usage metrics
- Tenant-tagged traces
- Noisy-neighbour alerts
- Audit logs
Real-world asset tokenisation flow
Off-chain
- 01
Asset onboarding
Legal structure and documents
- 02
Investor KYC
Identity and eligibility checks
- 03
Asset registry
Record of ownership and rights
- 04
Reconciliation
Registry matched to chain state
- 05
Reporting
Statements, audit and disclosures
On-chain
- 01
Token issuance
Mint against the registered asset
- 02
Allowlist
Only verified wallets can hold
- 03
Transfer controls
Rules enforced in the contract
- 04
Settlement
Atomic transfer against payment
- 05
Lifecycle events
Distributions, redemption and burn
Have a system that needs to work in production?
Tell us what you are building. An engineer will read it and reply within two working days.
