Course of Transactions [Infrastructure Design]

Javier FerrerRafa Gómez

By Javier Ferrer y Rafa Gómez Software Design and Architecture y Backend

Learn how and where to add transactions in your application to make it more maintainable.

💸 First lesson available without registration 💸

When we have a clean architecture, we typically have one repository for each use case. This implies that usually in each repository we only have one table, so we often do not need transactions.

The downside is that there’s a catch, and a big one. After each mutation (insertion or modification), we want to publish a domain event. And what happens if our queue system goes down?

This is where transactions come in handy. And although it may seem like a trivial decision, where we place it will determine how maintainable our code ends up being.

In this course, we will cover:

  • 👀 Where to make transactions: In the repository, in the use case, wrapping everything?
  • 🔙 Rollback of non-transactional operations: How can we perform the inverse operation?
  • 🥊 Comparative of transactions: The final decision

Related courses

Pay according to your needs

lite (only monthly)

19 €
per month

standard

24,92 €
Save vs monthly of 49 €
Annual payment of 299
per month
  • Main catalog to master writing maintainable, scalable, and testable code
  • Receive job offers verified by Codely
  • Company invoice
Save 189 €

premium

33,25 €
Save vs monthly of 89 €
100 € anniversary discount
Annual payment of 399
per month
  • Exclusive AI courses to keep you always up to date
  • Early access to new courses
  • Discount on workshops
  • Receive job offers verified by Codely
  • Company invoice

We won't increase the price while your subscription is active

Course of Transactions [Infrastructure Design] ﹤🍍﹥ Codely