Architecture
System Architecture: Decisions That Pay Dividends
Most architecture decisions don't matter. The framework, the deployment tool, the testing library — interchangeable. But a handful of early decisions shape everything that follows. After fifteen months of building AI products, here are the architecture choices that paid dividends and the ones that would have, if we'd made them sooner.
If you're building a product, an internal tool, or an AI system, you'll make hundreds of architecture decisions in the first few months. Framework choices. Database selections. Deployment strategies. API designs. Most of them won't matter — you can swap one for another without changing your outcomes.
But a handful of decisions will create gravity wells that pull everything else into orbit. These are the ones worth thinking about carefully, because reversing them later costs orders of magnitude more than getting them right early. Here's what actually matters, based on fifteen months of building production AI systems.
Decision 1: Where Computation Happens
Cloud vs. on-device. This single choice propagates through your entire product. On-device constrains model size, which constrains model architecture, which constrains what problems you can solve, which constrains your product roadmap.
That constraint is overwhelmingly positive — if your use case supports it. On-device forces discipline about what AI is actually needed versus nice to have. It pushes toward efficient architectures. It makes products work in conditions where cloud-dependent competitors fail. And it gives you a privacy story that becomes a compounding competitive advantage.
If your users work in environments with unreliable internet, if your data is sensitive, or if real-time processing matters — choose on-device. The engineering is harder. The product is better. And the privacy architecture pays dividends every quarter as the regulatory and competitive landscape evolves.
If your models are genuinely too large for mobile hardware or your application requires cross-user data aggregation, cloud is the right choice. But make it an explicit choice, not a default.
Decision 2: Your Data Architecture
The database choice matters less than you think. The data architecture matters more than you think.
Specifically: choose simplicity aggressively. A single SQLite file — the database is a file, backup is copying a file, migration is a script that reads and writes a file — has properties that compound for small teams: zero deployment complexity, no server configuration, no connection pools, perfect portability. The limitation (no high-write concurrency) only matters at a scale that means you've already succeeded beyond projections.
But more important than the database engine is how you structure your data model. Three principles that pay long-term dividends:
Events over state. Store events ("task created," "status changed," "decision made") rather than just current state ("status: active"). Current state is computed from events. This gives you a complete audit trail for free and enables context reconstruction from any point in time.
Context as a first-class entity. Don't bury project context in task comments or description fields. Give context its own structured storage, its own update history, and its own query interface. "What decisions have been made about the timeline for this project?" should return results from a query, not require searching through free text.
Explicit boundaries. Define where each project's data begins and ends. Define access scopes for each team member or agent. This isn't security theater for a small team — it's architectural clarity that prevents the context contamination that makes systems messy as they grow.
Decision 3: Platform Commitment
Picking a platform and going deep beats spreading across platforms and staying shallow. If you're building mobile tools and your target hardware has specific capabilities — LiDAR, Neural Engine, AR frameworks — committing to that platform lets you access capabilities that cross-platform abstractions can't reach.
The cost is real: you lose the other platform's market. But the gain is access to deep hardware integration that only exists because you committed. ARKit, Core ML, spatial computing features — these aren't abstractions you can port. They're capabilities that reward platform depth.
This applies beyond mobile. If you're building server-side tools, committing to a deployment model (containers vs. serverless vs. bare metal) early and deeply lets you optimize in ways that hedging across models doesn't. If you're building data pipelines, committing to a processing framework lets you exploit its strengths rather than using lowest-common-denominator patterns.
Commitment breeds optimization. Hedging breeds mediocrity. Pick the platform that matches your use case and go deep.
Decision 4: Memory and Context Infrastructure
This is the decision most teams make too late — and the one that costs the most to retrofit.
If you're building any system where multiple people (or AI agents) need to understand what happened previously — which is every operational system — build the memory and context infrastructure before you build anything else. Before the dashboard. Before the agent hierarchy. Before the first feature.
Context infrastructure means: every decision is logged with its rationale. Every project has a living context document. Every session (human or AI) starts by loading the relevant state. Every piece of implicit knowledge gets captured explicitly.
When you build context infrastructure first, every subsequent feature benefits from it automatically. When you build features first and add context later, you're retrofitting — which means rebuilding features that weren't designed for context awareness. That retrofitting cost compounds with every feature you ship before the context system exists.
Decision 5: Consultancy Alongside Product
This isn't a technology decision, but it shapes technology more than any framework choice. If you're building products for an industry, doing consulting work in that same industry gives you a continuous reality check that no amount of market research provides.
Consultancy engagements reveal how your users actually work, what they actually struggle with, and what actually saves them time. Product prototypes become consultancy tools. Consultancy insights feed product design. The feedback loop is tighter and more valuable than either activity alone.
The cost is context-switching overhead. Engineering time splits between consultancy deliverables and product development. But the information value — the constant calibration against real-world conditions — is worth more than the efficiency loss. Products built in isolation drift from reality. Products built alongside real engagements stay grounded.
The Meta-Decision: Be Opinionated
The thread connecting all these decisions: they're opinionated. On-device, not cloud. SQLite, not Postgres. iOS, not cross-platform. Consultancy-integrated, not isolated.
Having strong architectural opinions and building around them gives your system coherence that you can't get from following trends or choosing the most popular option. Some of your opinions will be wrong, and you'll adapt. But having opinions at all — and building around them — produces better architecture than trying to keep every option open.
The worst architecture decisions aren't the wrong ones. They're the ones you never explicitly made — the defaults you inherited because you didn't have a strong view. Those are the decisions that create the most expensive problems, because nobody remembers choosing them, nobody owns them, and nobody knows whether they're load-bearing or incidental.
Make your architecture decisions explicitly. Document them. Revisit them annually. And when one turns out to be wrong, change it — but change it deliberately, understanding what depends on it and what the migration path looks like. That deliberateness is what pays dividends over time.