Consider the following piece of code: public class Counter { private static int count = 0; // Static variable public Counter() { count++; // Increment count each time a new object is created } public static int getCount() { // Static method return count; } public static void main(String[] args) { Counter c1 = new... Continue Reading →
What Is Stream Processing ?
What is a data stream or event stream? A data stream is an abstraction representing an unbounded dataset. Unbounded that data is infinite and it grows over time as the new record keep getting added to the dataset. The data contained in the events or the number of events per second. The data differs from... Continue Reading →
Reliable Data Delivery In Kafka
If you are new to Kafka, please read the first two posts of the series given below. Else dive in. 🙂 Introduction to Kafka Kafka Internals What are the guarantees provided by Kafka? Guarantee of order Assume that there are two messages - Message A and Message B. Message B is sent after Message A... Continue Reading →
Monoliths vs Microservices
This article was originally written for nurture.farm's official blog - sprout. The original article can be found here. Microservice-based architectures have evolved from monolithic architectures as the expectation from a software system increased in terms of speed of deployment, separation of concerns, and scalability. The software systems that cater to millions of requests per minute... Continue Reading →
Introduction to Circuit Breaker In Software Engineering
What is common among mighty water dam, humble electric fuse, and i-dunno-what hysterix and hysterix-go? Take a moment to think of an answer. Yes. All of them are some sort of check that stops bad things from happening by deploying some safeguarding measure whenever a threshold is crossed. What exactly is circuit breaking? While researching... Continue Reading →
The curious case of rounding
Scenario 1 Let’s assume, we have a farmer named Chirag. Chirag booked a spraying service for one acre. Our spraying rate per acre is 10000 cents and we are offering a discount of 10.66 percent. So, he gets the following bill. Spraying CostDiscountTotalFinal after Rounding off10000 cents10.66%8934 cents89 $ He pays the bill before spraying, it's prepaid.... Continue Reading →
Is your API idempotent?
You would frequently find senior engineers asking this question in your code review. But what exactly is idempotency? Idempotency is basically operations that when done once or multiple times, gives you the same result. Have you used this two-way switch? If yes, do you think this is idempotent? (Last I heard, senior engineers were not... Continue Reading →
Using Guice for Dependency Injection
Prerequisite For Injecting dependency using guice, you should first know what is Dependency Injection. Please go through this article to understand Dependency Injection. Introduction Now that we know what is Dependency Injection, we can use it in our code. With dependency injection, objects accept dependencies in their constructors. To construct an object, you need first... Continue Reading →
Dependency Injection for beginners in a simple language
Mr. Das Mr Das hates travel. And more so the business ones. But as a Senior Integration Engineer, Mr. Das has to travel to the client's location. He has booked a nice hotel for his stay. Hotel has given Mr Das a phone number. He can dial the number from anywhere for any kind of... Continue Reading →
A Beginner Guide To Decorator Pattern
Which is your favourite Gun in PUBG? Mine is this one in the picture below. Who will name this? SCAR-L! That's right. It needs 5.56 mm bullet and is pretty handy. More about SCAR-L here. But! let's ask our friends in Pochinki? Has someone got 4x zoom? Why? Because you know that the assault rifle... Continue Reading →