Skip to main content

Posts

Showing posts from May, 2023

System design fundamentals: What is the CAP theorem?

👋 CAP Theorem is one of the important concepts used in Distributed Systems.  Its applicability to various systems states that any distributed system or data store can simultaneously provide only two of three guarantees: consistency, availability, and partition tolerance (CAP).The theorem formalizes the tradeoff between consistency and availability when there’s a partition. A distributed system is a network that stores data on more than one node (physical or virtual machines) at the same time. Because all cloud applications are distributed systems, it’s essential to understand the CAP theorem when designing a cloud app so that you can choose a data management system that delivers the characteristics your application needs most. CAP Theorem Proof Let’s look at a simple proof of the CAP theorem. Imagine a distributed system consisting of two nodes: The distributed system acts as a plain register with the value of variable X. There’s a network failure that results in a network partition b

Garbage Collection And It's impact on JVM Performance

👉 Garbage collection is one of those things that is generally known to impact performance, but beyond that – in terms of how it actually works – it’s pretty much a mystery to most of us. So I thought I'd take a whack at covering the basics of GC, especially since this is an area that has seen some major changes and improvements with Java 8, especially with the removal of the PermGen and some new and exciting optimisations (more on this toward the end). When we think about garbage collection, the vast majority of us know the concept and employ it in our everyday programming. Even so, there’s much about it we don’t understand, and that’s when things get painful. One of the biggest misconceptions about the JVM is that it has one garbage collector, where in fact it provides four different ones, each with its own unique advantages and disadvantages. The choice of which one to use isn’t automatic and lies on your shoulders and the differences in throughput and application pauses can be