Field notes · Architecture log

Architecture Log

Context budgets, cache isolation and execution placement. Explicit trade-offs in cost, latency, reliability and developer flow.

The role

I own the shared foundations (AI systems, APIs, data and transaction infrastructure) that other product teams build on. I started as a software engineer, building mobile apps, SDKs and deployment pipelines, so I make architecture trade-offs alongside engineering rather than handing requirements over the wall. I work day to day with CTOs, engineering managers, developers, data scientists, QA and support, and I tie every technical decision to cost, speed, reliability and P&L.

Architecture log · AI & runtime design

The constraints behind the product

How I weigh agent memory, inference cost and where work should run.

ADR 01 · Published memory design

Context pruning vs. full-context RAG

Context cost, retrieval relevance and response latency.

Decision rationale
Assemble a bounded context: procedural rules, account facts, relevant episodes and live session state. Retrieve what the current task needs rather than dumping every vector match into the prompt.
Trade-off
Pruning reduces token work but can omit useful context. Test recall and answer grounding before tightening the budget.
Read the memory architecture

ADR 02 · Published caching design

Exact vs. semantic cache boundary

Inference economics, answer correctness and tenant isolation.

Decision rationale
Check exact matches first, then scoped similarity and verification. Apply permissions before lookup; bypass actions and live account data, and invalidate answers when their sources change.
Trade-off
Higher similarity thresholds protect precision but reduce hits. Verification has its own cost; cache savings only count after embeddings, storage and quality regressions are included.
Read the caching essay

ADR 03 · MRes research

Edge scheduling vs. centralized compute

Bandwidth variability, execution scheduling and end-to-end latency.

Decision rationale
Research bandwidth prediction and real-time dynamic task scheduling to decide where work should execute between edge and cloud.
Trade-off
Local processing can reduce network waits but competes for client resources; centralized execution concentrates capacity but adds network dependency.
Read the research evidence

Architecture Log

Entry #001

Moving from monolith to microservices

Problem

A single deployable was blocking regional teams, coupling release trains and hiding ownership.

Decision

Split along domain boundaries with clear service ownership and a staged migration.

Trade-off

Accepted increased operational overhead and network complexity in exchange for independent team deployment velocity and clear domain boundaries.

Worked with

CTO and engineering managers on domain boundaries and migration order; developers on service contracts; QA on regression coverage during the migration.

What changed

Regional teams released independently, ownership became clear, and the platform could evolve one domain at a time.

Related: Developer platform cases →
Entry #002

Designing event-driven payment flows

Problem

Synchronous chains meant one slow dependency degraded the whole order and payment flow.

Decision

Async messaging with idempotency and failure isolation.

Trade-off

Accepted eventual consistency and ledger reconciliation latency in exchange for strict service isolation and resilient payment checkout flows.

Worked with

Engineering on idempotency and messaging; finance and support on reconciliation timing and how delays appear to merchants.

What changed

Created resilient workflows and reliable platform communication.

Related: Payments cases →
Entry #003

Building developer platforms

Problem

Every partner integration was bespoke, so onboarding time scaled linearly with the roadmap.

Decision

Versioned public APIs and SDKs with a governance model.

Trade-off

Enforced strict backward-compatibility rules and breaking-change governance, trading rapid feature rollout speed for enterprise partner integration stability.

Worked with

Engineering on API governance; partners as customers in design reviews; support on onboarding issues.

What changed

Partner integration moved from bespoke projects to self-serve. 3x API adoption, +40 Developer NPS, onboarding from weeks to days.

Related: Developer platform cases →
Entry #004

Moving AI from prototype to production

Problem

Demos were convincing, but nothing had evaluation, cost controls or a governance path to release.

Decision

No model ships without an evaluation gate, a cost and latency budget, and monitoring.

Trade-off

Capped model parameter scale and context depth to preserve sub-second latency budgets and unit economics over raw theoretical accuracy.

Worked with

Data science on evaluation gates and model size; engineering on serving latency and cost; QA on release criteria.

What changed

Balanced capability, cost, reliability, and governance.

Related: AI cases →
Entry #005

Architecting for the unreliable edge (POS, Tap to Pay & field logistics)

Problem

Store kitchens, field logistics and couriers face intermittent network drops, risking duplicate payment charges, lost orders or broken compliance audit trails.

Decision

Offline-first local SQLite sync, optimistic UI state updates, and idempotent queued requests for Tap to Pay and status transitions.

Worked with

Mobile engineers on offline sync; QA on network-failure testing; support on what merchants saw during outages.

What changed

Idempotent retries that stopped network drops from creating duplicate transactions, resilient order intake during peak Wi-Fi drops, and real-time auditable compliance.

Related: Payments cases →
Entry #006

Scaling for peak across multiple countries

Problem

Traffic spiked at the same predictable moments (meal times, weekends and campaigns) across 10+ markets. Peaks in one country could slow every other country sharing the platform.

Decision

Load tested against peak scenarios before major campaigns; PostgreSQL read replicas to take read traffic off the primary; Redis caching for catalogs and other hot data; queues to absorb bursts; rate limits per partner; and graceful degradation, so non-critical features like recommendations fell back to defaults under load instead of slowing checkout.

Trade-off

Accepted slightly stale cached data and the cost of extra capacity in exchange for checkout staying fast at the busiest moments.

Worked with

CTO and engineering managers on capacity and cost; developers on caching and degradation paths; QA on load testing; support on campaign readiness.

What changed

Peak traffic in one market no longer degraded others, and checkout stayed responsive at the busiest times.

Related: Payments cases →
Entry #007

Deploying across multiple regions

Problem

Serving markets across APAC and EMEA from one region meant extra latency for distant users, a single point of failure, and pressure from local data requirements.

Decision

Deployed across multiple regions, keeping customer-facing services close to users and planning regional failover.

Trade-off

Accepted higher infrastructure cost and more complex data synchronisation and releases in exchange for lower latency, resilience and the ability to meet local requirements.

Worked with

CTO on regional strategy and budget; engineering managers on release processes across regions; developers on data sync; QA on region-by-region release testing.

What changed

Faster response for users far from the original region, and an outage in one region no longer meant an outage everywhere.

Related: Developer platform cases →
Entry #008

Observability as a product requirement

Problem

Problems were found when merchants or partners complained. Engineering dashboards showed servers, not customers.

Decision

Defined observability from the customer's point of view: health per merchant and per partner, end-to-end tracing from app to payment to fulfilment, alerts on error rates and sync lag, and runbooks shared with support.

Trade-off

Spent roadmap capacity on monitoring instead of features, in exchange for finding and fixing issues before customers did.

Worked with

Engineering on tracing and alerting; support on runbooks and escalation paths; QA on monitoring new releases.

What changed

Issues were spotted and owned before merchants reported them, and support could answer "what happened?" without escalating every case.

Related: Developer platform cases →
Entry #009

Mobile architecture that survives old app versions

Problem

Mobile apps, kiosks and terminals don't update together. Users, merchants and devices ran several app versions at once, and any API change risked breaking the oldest ones.

Decision

Backwards-compatible APIs for every supported app version, feature flags to switch features on without releases, staged rollouts, and MDM to keep device fleets current. This is a lesson from my years as a mobile engineer.

Trade-off

Carried the cost of supporting older versions for longer, in exchange for never breaking a device in the field.

Worked with

Mobile developers on version support and feature flags; QA on testing across app versions and devices; support on version-related issues.

What changed

New features shipped without forcing updates, and API changes stopped breaking older apps and devices.

Related: Payments cases →
Entry #010

One canonical model for 50+ partners

Problem

Every partner described catalogs, orders, loyalty and payments differently. Building each integration separately made every new partner a project.

Decision

A middleware hub with one canonical data model, an adapter per partner at the edge, and event-driven sync.

Trade-off

Invested in the hub before knowing how many partners would come, and accepted the cost of mapping each partner to the shared model.

Worked with

CTO on the investment case; engineering on the canonical model and adapters; partners on contracts and certification; QA on contract tests.

What changed

50+ global and local partners connected through one hub, and each new partner became cheaper to add than the last.

Related: Developer platform cases →

Fig. 01 — Full-stack involvement

Every layer, from the device to the region

Platform decisions rarely sit in one layer. A checkout timeout can start in a mobile app, a database or a region. These are the layers I have made decisions in.

A former engineer's habit: follow the request all the way down before deciding where to fix it.

Fig. 02 — Decision-making

Architecture is a team sport

Platform PM

CTO

Direction, big trade-offs, build vs buy, and budget.

Engineering managers

Ownership, capacity and sequencing.

Developers

Design reviews, options and estimates.

Data science

Data contracts, model evaluation and serving budgets.

QA

Contract tests, release gates and regression coverage.

Support

Incident signals, runbooks and what customers actually feel.

  1. 01

    Frame the problem in business terms: cost, speed, reliability or revenue.

  2. 02

    Lay out options with engineering, including doing nothing.

  3. 03

    Make the trade-off explicit, and write down what we are giving up.

  4. 04

    Record the decision so the next team knows why.

  5. 05

    Roll out in stages, with monitoring from day one.

  6. 06

    Measure what changed, and revisit if it didn't.

Background

Why I can go deep with engineering

  1. 2012–2017

    Software engineer

    Mobile apps, third-party SDKs, CI/CD and API integration.

  2. 2017–2021

    Core platform

    Multi-tenant commerce platform, real-time transactions, ML recommendations.

  3. 2021–2024

    Multi-market platform

    Payments and API platform across 10+ markets in EMEA and APAC.

  4. 2024–now

    AI platforms

    Agentic workflows, RAG, MCP and evaluation, embedded with client teams.

Not a resume of technologies. A record of trade-offs, and who I made them with.