Modeling core financial domains with RESTful + CQRS at Nubank


Today at Nubank we have the challenge of providing robust internal APIs that serve multiple product teams and providing reliable data to external stakeholders. This imposes many and sometimes conflicting requirements (sync vs. async, transactional vs. analytical, etc).

In this talk you’ll see:

  • How we use Clojure’s persistent data structures to compute complex domain models in-memory
  • How we use Datomic’s flexible data shaping to store the appropriate level of detail for different use cases
  • How we implement idempotent REST API updates using Datomic’s append-only database
  • How we implement aggregate versioning using Datomic’s Compare-and-Set and exposing thru HTTP headers
  • How we use Clojure’s extensibility for easy error handling of API requests


Gustavo Barrancos (Nubank)
Gustavo is a Software Engineer and systems nerd at Nubank. Over the years worked on different domains such as VoIP systems,
mobile games, cloud infrastructure and more recently with Credit Origination Backends within Nubank.

Henrique Alves (Nubank)
Nubank old-timer (4 years tenure) that have seen a lot of concurrency issues in distributed systems and complicated financial reports =)