What does ACID mean?
The diagram below explains what ACID means in the context of a database transaction.
🔹 Atomicity
The writes in a transaction are executed all at once and cannot be broken into smaller parts. If there are faults when executing the transaction, the writes in the transaction are rolled back.
So atomicity means “all or nothing”.
🔹 Consistency
Unlike “consistency” in CAP theorem, which means every read receives the most recent write or an error, here consistency means preserving database invariants. Any data written by a transaction must be valid according to all defined rules and maintain the database in a good state.
🔹 Isolation
When there are concurrent writes from two different transactions, the two transactions are isolated from each other. The most strict isolation is “serializability”, where each transaction acts like it is the only transaction running in the database. However, this is hard to implement in reality, so we often adopt loser isolation level.
🔹 Durability
Data is persisted after a transaction is committed even in a system failure. In a distributed system, this means the data is replicated to some other nodes.
--
Subscribe to our weekly newsletter to get a Free System Design PDF (158 pages): https://t.co/eVEdOFSYPY
6 Software Architectural Patterns You Must Know
Choosing the right software architecture pattern is essential for solving problems efficiently.
1 - Layered Architecture
Each layer plays a distinct and clear role within the application context.
Great for applications that need to be built quickly. On the downside, source code can become unorganized if proper rules aren’t followed
2 - Microservices Architecture
Break down a large system into smaller and more manageable components.
Systems built with microservices architecture are fault tolerant. Also, each component can be scaled individually. On the downside, it might increase the complexity of the application.
3 - Event-Driven Architecture
Services talk to each other by emitting events that other services may or may not consume.
This style promotes loose coupling between components. However, testing individual components becomes challenging
4 - Client-Server Architecture
It comprises two main components - clients and servers communicating over a network.
Great for real-time services. However, servers can become a single point of failure.
5 - Plugin-based Architecture
This pattern consists of two types of components - a core system and plugins. The plugin modules are independent components providing a specialized functionality.
Great for applications that have to be expanded over time like IDEs. However, changing the core is difficult.
6 - Hexagonal Architecture
This pattern creates an abstraction layer that protects the core of an application and isolates it from external integrations for better modularity. Also known as ports and adapters architecture.
On the downside, this pattern can lead to increased development time and learning curve.
Over to you: Which other architectural pattern have you seen?
--
Subscribe to our weekly newsletter to get a Free System Design PDF (158 pages): https://t.co/xOtKy03EXx