Distributed Systems 2 min read

Invoice and debt collection subsystem

A debt collection integration built as an event-driven subsystem, so the rest of the estate never had to know the vendor existed.

A customer needed to integrate with an external debt collection service. The integration itself is not the interesting part. What a third-party vendor does to the shape of the surrounding systems, is.

Context

August to December 2024, through Sonat AS, as architect and developer.

Rather than wiring the vendor into the applications that needed it, the integration was built as a subsystem within a distributed system, consumed by other applications through events. The supported use cases:

  • Onboard companies as creditors
  • Register new debt claims on behalf of creditors
  • Register payments
  • Notify creditors when a claim is fully paid

My role

Solo architect and developer.

Key decisions

The subsystem boundary is the decision. Everything downstream follows from having put the vendor behind an event contract instead of letting callers depend on it directly.

This was the first mini-project for this customer. The following project was a full legacy system mapping a design and plan for a new system. With that context, the first mini-project had be able to fit into the future system landscape. Debt collection integrations gets replaced over time and a creditor-facing notification obligation is the kind of requirement that leaks everywhere if you let it.

Tradeoffs

Event-driven buys decoupling and costs you a straightforward answer to “what is the current state of this claim?”. How did that land here, in a domain where the answer involves money.

Outcome

The system was delivered on time.

Lessons learned

Avoid solo projects with short delivery time. It drains too much energy. Being alone means you are on the critical path of the project tasks during the entire project timeline.

Integrating with external systems are always a risk regarding how available they are to help with finalizing the setup and access. You have no guarantee they will hold their promises. The documentation is a story of itself and almost always stale.

C# · .NET Core · PostgreSQL · AWS · Distributed Systems · System Architecture

All projects