String: Why it is Immutable?

Why String is Immutable?
This is one of the most popular interview questions. In this blog, we are going to talk about it and find the answer. String is one of the most used Class in any Application. For storing the username, password, address, IP address etc, we need to create String objects. So it is necessary to understand why our most famous and used Class is Immutable.

First of all let’s see what Immutable means:

Continue reading “String: Why it is Immutable?”

An Introduction to OpenTSDB

In our last three blogs, we have talked about the HDFS, Zookeeper & HBase Cluster, which is needed for deploying OpenTSDB in clustered mode. Continuing to the series, In this blog, we will finally deploy the OpenTSDB.

OpenTSDB is a distributed, scalable, time series database built on top of Hadoop and HBase.

OpenTSDB can collect, store & serve billions of the data points without any loss of precision. Which makes it a perfect solution for the monitoring system.

Continue reading “An Introduction to OpenTSDB”

An Introduction to HBase

In our last two blogs, we talked about the HDFS Cluster & Zookeeper Cluster. Which is needed for deploying OpenTSDB in clustered mode. Continuing to the series, In this blog, we are going to talk about HBase which will be used by OpenTSDB in the cluster to store data.

HBase is a column-oriented NoSQL database management system that runs on top of Hadoop Distributed File System (HDFS).

Continue reading “An Introduction to HBase”

Redis : A Caching Database

Redis_Logo.svg

Redis stands for Remote Dictionary Server. It is opensource, in-memory key value data strucure store, which is extremely fast. In other words, it can also called as caching no sql database.
So, Redis is no sql database which can be used as a cache or message broker. The data structure supported by it are lists, hashes, strings, sets, sorted sorts with range queries, bitmaps, hyperloglogs and geo spatial indexes with radius queries. It has built in replication, Lua scripting, LRU eviction, transcations and different levels of one-disk persistence. It also provides high availiblity via Redis Sentinel and automatic partitioning with Redis cluster.

Continue reading “Redis : A Caching Database”

An Introduction to ZOOKEEPER

In our last blog, we talked about the HDFS cluster. Which is needed for deploying OpenTSDB in clustered mode. Continuing to the series, In this blog, we are going to talk about ZOOKEEPER which will be used by HBase & OpenTSDB in the cluster.

Before talking about ZooKeeper lets understand what is Distributed system and the need of ZooKeeper in Distributed System.

Distributed System:

When a software system composed of independent computing entities linked together by a computer network and its components communicate and coordinate with each other to achieve a common goal is known and Distributed System.  ex: Multiplayer online games like Clash of Clan

Continue reading “An Introduction to ZOOKEEPER”

An Introduction to HDFS

We are going to start a series of blog on HDFS, Zookeeper, HBase & OpenTSDB and will see How to setup an OpenTSDB cluster using these services. In this blog, we will study about HDFS.

HDFS:

The Hadoop Distributed File System (HDFS) is a Java-based distributed file system that is fault-tolerant, scalable and extremely easy to expand. It is designed to run on commodity hardware and can be deployed on low-cost hardware. HDFS is the primary distributed storage for Hadoop applications. It provides interfaces for applications to move closer to data.

Continue reading “An Introduction to HDFS”

Callable & Future in simple words

Sometimes we have to run a long-running task in a separate thread and return the result once execution is complete. Using Java Runnable interface we can run a task, but the disadvantage is it does not return result once execution is complete.

Then how can we achieve this?

There are two interfaces available in java.util.concurrent package using them we can solve this problem.

Continue reading “Callable & Future in simple words”

Facade Design Pattern

Facade Design Pattern is the Structural design patterns (like Adapter pattern and Decorator pattern). Facade design pattern is used to easily interact with the complex system.

According to Design Patterns: Elements of Reusable Object-Oriented Software (Gang of Four) Facade design pattern is:

Provide a unified interface to a set of interfaces in a subsystem. Facade Pattern defines a higher-level interface that makes the subsystem easier to use.

Continue reading “Facade Design Pattern”

DECORATOR DESIGN PATTERN

Let’s imagine we want to create a game, and for our superhero, we want to add a new gadget to every level of the game and gadget should be selected by the player.

How we can do that?🤔

One way to do that use traditional inheritance, We will create a base abstract gadget class and multiple subclasses for different gadget combination.

But wait I have n numbers of gadgets so in my case I have to create n! subclasses.

If n = 5 then for 5 powers the number of subclasses will be 5! = 120. For 5 gadget we have to create 120 subclasses.😢

Is there any other simple way to do that?

Yes, We can use Decorator Design Pattern to solve this problem.

Decorator Design Pattern allows behavior to be added to an individual object, either statically or dynamically, without affecting the behavior of other objects from the same class

Continue reading “DECORATOR DESIGN PATTERN”

JAVA EE to JAKARTA EE

The acquisition of Sun Microsystems by Oracle Corporation was completed on January 27, 2010, and became the owners of Java.

In September 2017, Oracle gave up on Java Enterprise Edition (JEE), aka J2EE, to The Eclipse Foundation. On February 2018, The open source version of Java Enterprise Edition (Java EE) has been renamed Jakarta EE to satisfy Oracle’s desire to control the “Java” brand.

Continue reading “JAVA EE to JAKARTA EE”