Architecture
What a real-time pipeline actually costs to run, and when batch is enough
The expensive part of Kafka is rarely the logo on the diagram. It is retention, consumer lag, a dead-letter queue somebody owns, and a person who can be woken up. If you cannot name that person, you are not ready to run a stream. Start with a batch job and one check that fails in the open.
Batch is the default
A number a person reads in the morning does not need to move as an event. Finance closes, a board pack, a daily cohort, a warehouse table the sales team filters: Airflow on a schedule, a warehouse, and a test that yesterday’s load matches the source. That design has a deadline, a log, and a retry. It also has a cost you can explain.
The platforms in the ngpems work use both. Kafka where a service has to react. Airflow where the work is a batch with a deadline. RabbitMQ where two services should not wait on each other. The split is the design. Putting every extract on a broker is how a small team inherits an on-call rota it cannot staff.
Stream when the product waits
Stream when a feature is wrong if it waits for the next batch. A limit that has to move with the request. A model scoring a live transaction, as on the Rootz systems. A proxy such as Latch sitting on the request path, answering on the machine next to the API.
In those cases the cost is justified because the alternative is a product that lies until the next job. The cost is still real:
- The cluster or the managed service, including disks for the retention you actually need.
- Schema changes and the consumers you forgot to update.
- Monitoring that pages a person, and a queue for the messages that failed.
- The hours to keep it honest after the first demo.
A practical test
Write down the decision the data serves, and who is in the room when it is made. If that person can wait until the next scheduled job, batch is the architecture. If a customer, a trade, or a control action is waiting on this event, stream that path only. Leave the reports on a schedule.
A database or a cloud warehouse is where people query. It is not a reason to stream. Analytical reads are happy with a load every few minutes, or every night, if the question is a report.
The pipeline sprint exists for the path you have already decided must be in production, with monitoring and a handover. If you are still unsure which path that is, the audit is the cheaper way to find out.
Score the platform you have
Ten questions, a score out of 100, and three next steps.