Product request
The UI does not reach into Product tables. It crosses an application boundary with a validated result.
Product architecture / platform engineering / resilient delivery
I took a working video and social platform whose services were separated mostly on paper—and made its boundaries testable, its failures visible, and its releases safer to operate alone.
independent component images
plus three Worker bundles and a recovery artifact
listed passing tests
across contracts, services, infrastructure, routes and policy
governed database relations
63 owner tables and 19 consumer Read Models
release-manifest subjects
all bound to one exact source revision
OpenReels already had Next.js, Bun processes, PostgreSQL, Redis, RabbitMQ, private object storage and an authenticated CDN path. It looked service-oriented. In practice, pages still knew transport details, processes shared schema knowledge, local development needed too much infrastructure, and a failed dependency could quietly masquerade as an empty screen.
At the same time, production behaviour already mattered. I could not “clean up” the architecture by casually replacing protected media, rewriting the database, or weakening the exact-SHA release path. The migration had to improve changeability while keeping every existing safety boundary explainable and recoverable.
A process boundary is not a product boundary if callers still share its assumptions, tables and failure shortcuts.
Service boundaries were visible in the process diagram.
Product boundaries became executable through shared runtime contracts and owner interfaces.
A dependency outage could look like an empty product state.
Empty and Unavailable became different results, with different UI and recovery behaviour.
Frontend work could require the database, queue, mail, storage and cloud configuration.
Real routes run against deterministic, authenticated scenarios without Docker or cloud credentials.
Processes shared schema knowledge and convenient cross-domain access.
Owners write their own state; other modules use contracts, Read Models, events or commands.
This public map deliberately excludes credentials, internal addresses and operating procedures. It shows responsibility—not exploitable topology.
The UI does not reach into Product tables. It crosses an application boundary with a validated result.
A state change and its message are committed together; consumers remain safe under at-least-once delivery.
Authentication and authorization happen before cache or object access, including HEAD and byte-range requests.
Product
Next.js 16 · React 19 · Bun
State
PostgreSQL 15 · Redis 7
Messaging
RabbitMQ 4 · owner relays
Delivery
Cloudflare Workers · private R2
These were not technology swaps. Each decision changed who owns a fact, how failure is represented, or what evidence is required before a change becomes real.
TypeScript types alone cannot protect a process boundary. I introduced Zod contracts for requests, results, failures, events and adapter parity.
Live HTTP and Socket adapters satisfy the same interfaces as deterministic scenario adapters. This catches drift at the seam and lets the frontend represent dependency failure honestly instead of silently turning it into “no data”.
A database-per-service rewrite would have increased operational risk without solving the immediate design problem.
I kept one PostgreSQL cluster, then made ownership real through eleven checksummed owner migration streams, distinct runtime roles, owner commands, consumer Read Models and a blocking source scan. The app has connectivity for health checks but no Product-table privilege.
Publishing after a database commit leaves a crash window. Publishing before it risks announcing state that never existed.
Transactional owner outboxes, independently credentialed relays, RabbitMQ confirms and consumer-owned receipts make at-least-once delivery explicit. Invalid messages are quarantined, transient work retries within bounds, and redrive is preview-first and allowlisted.
A private bucket is not enough once media is cached, streamed, renewed and removed across product surfaces.
OpenReels separates ingest, product, chat and moderation storage. Product records keep opaque asset identities, while short-lived viewer-and-asset-bound grants protect delivery. Long-lived pages renew exact visible assets without reloading the feed or weakening grant lifetime.
The Knowledge Assistant is a Product Module, not a chat box pasted onto the interface.
Availability requires the deployment switch, provider readiness, published knowledge and administrator enablement. If any gate fails, the user boundary returns a generic 404 and Social removes the Assistant from conversation, search and unread surfaces. The current capability is retrieval-only; no agentic tool can execute.
“The previous version was healthy” is not enough if contracts, database shape or trust policy have changed. Releases now carry the evidence needed to decide whether one component can move alone, whether a coordinated rollout is required, and whether application rollback remains legal.
Non-negotiable
Database evolution is forward-only. Production is a separate manual action selecting a complete, validated beta SHA.
A ready pull request produces a deterministic validation plan and evidence bound to the exact tested Git tree.
Sixteen minimal non-root component images and three Worker bundles are built from one full source SHA.
Digests, compatibility fingerprints, provenance subjects and the bounded recovery image become one attested release identity.
Production accepts only a complete beta SHA. Database changes move forward; application rollback is allowed only when compatibility is proven.
Health, workload trust, Workers, storage, TLS and external smoke checks must pass before finalization.
Validation evidence is bound to the tested tree, policy digest and selected suites—not just a green check with an ambiguous source.
Each runtime carries its declared entry point and dependency closure, runs non-root and is selected by digest.
Candidate services and Workers prove caller identity, audience, route binding and replay rejection before ordinary traffic moves.
The August 2026 test inventory lists 1,019 passing tests. Typechecks, schema checks, migration replays, Compose rendering, shell analysis, Worker dry runs, image inspection, vulnerability scans and external production smoke checks are additional gates—not padded into that number.
Integration suites use disposable PostgreSQL, RabbitMQ, Mailpit and MinIO. They are explicitly forbidden from targeting shared or production systems.
Executable test inventory
1,019
Failure
dependency loss, recovery, drain and bounded retry
Security
auth, ownership, replay, cache and grant denial
Compatibility
twice-applied migrations and old/new contract overlap
Operations
health, evidence, rollback and exact artifact identity
What I took from the work
Once Empty, Unavailable, Event, Command and owner boundaries had precise meanings, the code and tests became much easier to reason about.
A media rule is incomplete unless issuance, renewal, cache lookup, range delivery, invalidation and rollback all agree on it.
The goal was not to imitate a large company. It was to gain independent change boundaries while keeping recovery understandable for one person.