Rafael Pereira — Senior Software Engineer

I work at the points where simple systems stop being simple.

Case studies, projects, and technical writing on scale, failure, legacy systems, and business rules. Each piece shows the constraint, the decision, and where the solution stops.

Method

The constraint comes before the diagram.

I start with what happens when a message fails.

The database cannot change. The legacy core cannot stop.

The happy path comes later.

The decision records the discarded alternative and the condition that would justify revisiting it.

Code shows what was built; the case shows why.

Proof

Three systems, three constraints

Infosistemas Feb/2025 – May/2026

~98% fewer intermittent failures in critical flows

Infosistemas: a failure contract for RabbitMQ messaging

Intermittent failures between microservices with no contract for retry, DLQ, or duplication. Adding more consumers only pushed the overload elsewhere.

Open the case

Contrato de falha na mensageria
Contrato de falha na mensageria Publicação confirmada segue para uma fila durável e um consumidor idempotente. Falhas temporárias retornam para retry com backoff; falhas permanentes seguem para a DLQ. Publicação confirmada Fila durável prefetch controlado Consumidor idempotente retry + backoff DLQ por fluxo duplicidade não repete efeito de negócio

Publicação confirmada, consumo com prefetch controlado, retry com backoff e DLQ por fluxo. Escalar só consumidores fica de fora do desenho.

Ver o caso

VBET Oct/2023 – Feb/2025

~7 min → <1 s commissions, from the original load to the warm cache

VBET: analytics on top of a SQL Server we could not change

The database belonged to another team. The dashboard had to stop depending on a schema we did not control.

Open the case

Pipeline de comissões
Pipeline de comissões Dados de um SQL Server externo passam por ETL para uma base PostgreSQL própria, depois por cache, e alimentam leituras REALTIME e CLOSED. SQL Server externo ETL PostgreSQL pré-cálculo Cache Leituras dashboard REALTIME tendência CLOSED pagamento ~7 min no pico, menos de 1 s com cache quente

Cada estágio corresponde a uma decisão incremental documentada no case. Números de outras histórias não entram neste desenho.

Ver o caso

Flapper Sep/2021 – Jun/2022

~25% fewer tables in the domain-based split

Flapper: discovering the domain before splitting the monolith

The product could not stop, and the original authors were already gone. Before migrating, we had to discover which boundaries the database still revealed.

Open the case

Descoberta de domínio antes da migração
Descoberta de domínio antes da migração O banco do monólito PHP revela fronteiras de domínio. Pessoas, autenticação e aeronaves saem gradualmente para contextos com persistência própria. Monólito PHP banco como fonte de descoberta Pessoas Autenticação Aeronaves Strangler: um domínio por vez, sem parar o produto

O banco legado revela fronteiras; pessoas, autenticação e aeronaves saem gradualmente para contextos com persistência própria.

Ver o caso

Artifacts

Selected projects

Public repository

SMS Manager

Importing CSV must not block the Nest API. The campaign persists and publishes to RabbitMQ; consumers in TypeScript, Go, or Rust record the result in Mongo. The API does not wait for the carrier.

Open the project

Desacoplamento da campanha
Desacoplamento da campanha CSV entra na API Nest, que persiste em PostgreSQL e publica na fila RabbitMQ. Consumidores em TypeScript, Go ou Rust, no mesmo contrato, registram o resultado no MongoDB. A API não bloqueia no ritmo da operadora. CSV upload API Nest campanha Postgres persistência API → fila Fila RabbitMQ TS Go Rust mesmo contrato Mongo resultado API não espera a operadora

CSV na API Nest com persistência Postgres; publicação na fila; consumidores no mesmo contrato gravam no Mongo. A API não espera a operadora.

Documented experiment

goc_mcp

Maestro (Codex/Cursor) delegates over MCP; FIFO daemon and OpenCode workers execute with state in SQLite. Orchestration worked, but measurement did not confirm cost or time reduction.

Open the project

Orquestração local via MCP
Orquestração local via MCP Maestro MCP delega tarefas a workers OpenCode via daemon FIFO, um worker por vez. Estado em SQLite. A hipótese de reduzir tempo e custo não foi confirmada nas medições. Maestro MCP / Codex · Cursor Daemon · FIFO 1 worker por vez Worker OpenCode Worker OpenCode Worker OpenCode SQLite hipótese tempo/custo não confirmada

Maestro delega; daemon FIFO coordena um worker OpenCode por vez; SQLite guarda estado. A hipótese de eficiência não se confirmou.

Own product, desktop

md2cv

Profile and immutable versions stay in the machine's SQLite. The supervised agent only proposes changes under schema; ATS and PDF/DOCX export reuse the same graph, with no SaaS backend owning the data.

Open the project

Grafo local e agente supervisionado
Grafo local e agente supervisionado Perfil e currículos no SQLite local; versões imutáveis; candidatura no mesmo contexto; agente supervisionado propõe sob schema e só grava com confirmação; auditoria ATS e export PDF/DOCX. Sem backend SaaS como dono dos dados. Grafo do perfil SQLite · WAL · máquina local Versões imutáveis Markdown · restauração Candidatura vaga · versão Agente supervisionado confirma antes de gravar ATS PDF / DOCX sem SaaS dono

Perfil e versões no SQLite; candidatura no mesmo contexto; agente só propõe sob schema; ATS e export reutilizam o grafo sem SaaS dono.

See all projects

Path

A trajectory of systems, not of job titles

  1. 2025 to 2026

    Architecture

    Rental and fleet platforms. The public proof from this period is the messaging redesign.

    Infosistemas

  2. 2023 to 2025

    Analytics on an external database

    SQL Server owned by another team. The dashboard had to work without relying on a schema we did not control.

    VBET

  3. 2023

    Post-sale over a legacy core

    PHP 5.7 still ran the operation. Automation had to free support without rewriting the monolith.

    Maxmilhas

  4. 2022 to 2023

    Multi-tenant marketplace

    White-label so banks could join without a per-client fork.

    South System / QUIQ-Itaú

  5. 2021 to 2022

    Incremental modernization

    The monolith had no original authors. Migration started with the parts of the database we could still read.

    Flapper

Practice

How the work proceeds

Each step constrains the next. Without those constraints, architecture becomes personal taste.

How the work proceeds

01

Context

Who is hurt when this breaks, and in which operation.

02

Constraint

What cannot stop, change, or be treated as extra capacity.

03

Decision

The path taken, with the discarded alternative kept visible.

04

Evidence

What was measured, in which scenario, with whose authorship.

05

Limit

The condition that would justify revisiting the decision.

Contact

Dealing with a system that's stopped being simple?

Reach out directly via @imrafaeldev, no form — for professional conversation, start on LinkedIn.

Open the contact page