How to scale a legacy system with event-oriented architecture (without rewriting it)
Primeiro post de uma série sobre arquitetura orientada a eventos (EDA), construída em público a partir de um case fictício: a Faculdade Leal. Este post fica em nível de arquitetura — a implementação (Apache Camel, código dos consumers, etc.) vem nos posts seguintes, conforme for sendo construída. O problema Imagine que você é responsável pelo financeiro de uma faculdade grande. Todo mês, o…
A series of articles will discuss Event-Driven Architecture (EDA) built using a fictional case study of Faculdade Leal. The current system for generating invoices for thousands of students takes around 4 days and causes performance issues when many users access the site simultaneously. The existing architecture has a batch process for calculating invoices and an on-demand process for generating invoices and fiscal notes.
The proposed solution involves creating indexes, a data purging process, and implementing EDA. This includes using a messaging broker, Kafka, with well-defined events. The new architecture consists of several components, including producers and consumers that react to events such as fatura.pronta, fatura.finalizada, boleto.solicitado, boleto.gerado, and notafiscal.pronta.
The implementation will be done in several stages, starting with a simpler solution using polling, which may be replaced with a more ideal solution using CDC/Debezium if the required access is available. The new architecture aims to decouple the stages and reduce the load on the legacy system.
Written by urgent.news from Dev.to's report — not a translation of it. Machine-written — may contain errors; check the original before relying on it.