Course of Infrastructure Design: Transactions

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

See full catalogue

Pay according to your needs

lite (only monthly)

19 €
per month
  • Access to a subset of courses to lay the foundation for maintainable, scalable, and testable code
  • Company invoice
Popular

standard

24,92 €
Save 121
Annual payment of 299
per month
  • Full course catalog
  • Design and architecture challenges
  • Highlighted solutions videos for challenges
  • Receive job offers verified by Codely
  • Company invoice

premium

41,58 €
Save 89
Annual payment of 499
per month
  • All previous benefits
  • Early access to new courses
  • More benefits coming soon

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