Posts

Showing posts with the label Micro Services

Observability Done Right: Best Practices and Anti-Patterns for Effective System Monitoring

Image
  WHAT Observability is a concept that refers to the ability to gain insights into the behavior and performance of complex systems. In the context of software engineering, observability involves the collection, analysis, and visualization of data from software applications, infrastructure, and other components of a system. In the animal kingdom, observability plays a critical role in survival, allowing animals to monitor their surroundings, detect threats, and find food. Dolphins use echolocation to observe their surroundings. They emit high-frequency sounds that bounce off objects, allowing them to create a 3D map of their environment. Thanks for reading Knowledge Cafe! Subscribe for free to receive new posts and support my work. Subscribed WHY In today's era, architectures are becoming increasingly large, complex, and fast-paced due to the faster development and deployment of software by distributed teams with the help of DevOps, continuous delivery, and agile development methodo...

Distributed Transaction in Spring Boot Microservices

Image
  Distributed transactions in microservices refer to transactions that involve multiple microservices, each handling a part of the transaction, and coordination is required to ensure the transaction’s atomicity, consistency, isolation, and durability (ACID) properties. Spring Boot provides several features to manage distributed transactions in a microservices architecture. Spring Boot can use either the 2PC or Saga pattern to manage distributed transactions, depending on the specific needs of the application. One way to implement 2PC in Spring Boot is to use the XA (eXtended Architecture) protocol, which allows multiple databases to participate in a single transaction. Spring Boot provides support for XA transactions through the Atomikos and Bitronix transaction managers, which can be used to coordinate transactions across multiple services. Another approach is to use the Saga pattern, which can be implemented in Spring Boot using the Spring Cloud framework. Spring Cloud provides a...

Chaos Engineering : Game Day

Image
  What is chaos engineering: Chaos engineering is a methodology that helps developers attain consistent reliability by hardening distributed services against failures in production. Another way to think about chaos engineering is that it's about embracing the inherent chaos in complex systems and, through experimentation, growing confidence in your solution's ability to handle it. A common way to introduce chaos is to deliberately inject faults that cause system components to fail. The goal is to observe, monitor, respond to, and improve your system's reliability under adverse circumstances. Why Chaos Engineering? Contrary to what the name may indicate, chaos events are not performed in a chaotic fashion. The goal of chaos engineering is to identify weakness in a system through controlled experiments that introduce random and unpredictable behavior. A main benefit of chaos engineering is that organizations can use it to identify vulnerabilities before a hacker does or befor...

Container Patterns

Image
  Why we need Container Patterns: Due to popularity of microservices and distributed computing, containerization has become a major trend in software development.  It involves encapsulating or packaging software code and all its dependencies so that it can run uniformly and consistently on any infrastructure.  In distributed architecture which consists of many microservices, we want our microservices business focused and keep non functional aspects like security, service discovery, proxy, logging and platform configuration etc out of our microservices code, container patterns evolved.  There are 2 popular patterns: Sidecar Ambassadors Sidecar pattern:  In this pattern, we schedule a workload on the same hosts which is intended for specific things that don’t concern your application. There are various use cases for sidecar patterns like request authentication/authorization, service discovery, adding HTTPS to legacy service.  Usecase : We will d...

Distributed Transactions in Microservices

Image
  What is a distributed transaction? Microservices architecture has been very popular architecture pattern in recent time. However, one common problem is how to manage distributed transactions across multiple microservices.  When a microservice architecture decomposes a monolithic system into self-encapsulated services, it can break transactions. This means a local transaction in the monolithic system is now distributed into multiple services that will be called in a sequence. Lets try to understand this concept with hypothetical train ticket booking system. Consider below ticket booking monolith application.  In the train ticket booking example above, if a actor sends a book ticket action to a monolithic system, the system will create a  local database transaction that works over multiple database tables (account table, booking table). If any step fails, the transaction can roll back and data consistency is guaranteed by database's ACID (Atomicity, Consistency, Isol...