Table of Contents

https://www.serch.dev/blog/2020/02/14/model-view-controller-no-es-malo-es-la-sociedad-que-lo-corrompe.html https://es.wikipedia.org/wiki/Active_record

Layered (n-tier) architecture

This approach is probably the most common because it is usually built around the database, and many applications in business naturally lend themselves to storing information in tables.

The Model-View-Controller (MVC) structure, which is the standard software development approach offered by most of the popular web frameworks, is clearly a layered architecture

Advantage: the separation of concerns => Maintainable, Testable, Easy to assign separate "roles", Easy to update and enhance layers separately Caveats:

Microservices architecture

It depends on developing small, independent modular services where each service solves a specific problem or performs a unique task and these modules communicate with each other through well-defined API to serve the business goal enter image description here

enter image description here

Advantages:

Caveats:

Best for:

CQRS

CQRS is an acronym for Command and Query Responsibility Segregation. The central concept of this pattern is that an application has read operations and write operations that must be totally separated. This also means that the model used for write operations (commands) will differ from the read models (queries). Furthermore, the data will be stored in different locations. In a relational database, this means there will be tables for the command model and tables for the read model. Some implementations even store the different models in totally different databases, e.g. SQL Server for the command model and MongoDB for the read model.

This pattern is often combined with event sourcing, which we’ll cover below. When a user performs an action: enter image description here

When the application needs to show data to the user: enter image description here

Advantages

Event Sourcing

This is a pattern where you don’t store the current state of your model in the database, but rather the events that happened to the model. So when the name of a customer changes, you won’t store the value in a “Name” column. You will store a “NameChanged” event with the new value (and possibly the old one too). A real-life analogy of event sourcing is accounting. When you add an expense, you don’t change the value of the total. In accounting, a new line is added with the operation to be performed. Advantages