In Q2 2023, we faced a hard decision at Prata Digital: our credit core was working, but breaking from the inside. Not spectacularly — silently. Latency accumulating. Couplings that shouldn't exist. A processing queue that, on peak days, took hours to drain.
The question wasn't "does this need to change?". It was: how do we change without stopping anything?
The Three Options on the Table
- Big Bang Rewrite: rebuild everything from scratch in parallel, migrate when ready. High risk, high visibility — and a historical graveyard of projects that never left "parallel".
- Incremental patching: fix the most critical issues without touching the architecture. Buys time, doesn't solve the root cause.
- Strangler Fig Pattern + event-driven migration: wrap the existing system with new services, gradually redirect flows, let the monolith die naturally as the new system grows.
We chose the third. And the reason wasn't technical — it was philosophical: the only safe migration is one that can be undone.
The Architecture That Emerged
The result was a choreography of AWS services: Lambda for stateless execution of each step in the credit process, DynamoDB for storage with predictable latency, SQS and EventBridge for asynchronous orchestration across risk analysis, Caixa Econômica Federal API integration, and funding release domains. Each domain with its own bounded context. No service knowing more than it needed to about another's state.
Four Months in Production, Zero Incidents
The migration ran four months in production. No user-visible incidents. Not because we were lucky — because every step was reversible. Feature flags controlled which flow went to the new architecture. Any anomaly, traffic reverted to legacy in seconds.
Key concepts from this migration
What is the Strangler Fig Pattern?
Clique para ver a respostaA migration technique where the new system gradually wraps the legacy one, redirecting functionality piece by piece. The old system naturally "withers" while the new one grows — no big bang, no downtime.
Why are feature flags critical in migrations?
Clique para ver a respostaThey allow instant traffic redirection between systems. Every migration step becomes reversible in seconds, turning a high-risk process into a series of safe micro-decisions.
What is a bounded context in microservices?
Clique para ver a respostaAn explicit boundary within which a domain model is consistent. Each service knows only what it needs — no state leaking between domains.
What's the difference between service orchestration and choreography?
Clique para ver a respostaIn orchestration, a central service coordinates the others. In choreography, each service reacts to events with no central coordinator — more resilient, but harder to observe.
The Numbers
- 99.9% availability — documented over the following 12 months, not as a goal but as reality.
- 4 hours → 8 minutes in the heaviest pipeline processing. A 97% reduction.
- R$1 billion+ transacted since then, without a single failure affecting the end user.
The most important architectural decision I made wasn't technical — it was about cadence. Resisting the impulse to do everything at once. Boring technology that works perfectly is engineering's most underrated luxury.
The best architecture is the one that never stops working silently.
— Victor Fornitani

