Skip to main content

Posts

Showing posts with the label apache

Data Migration Strategies for MySQL databases

Data Migration Strategies for MySQL Databases: An Overview of few Approaches Introduction: Data migration is a crucial aspect of database management, especially when transitioning from one MySQL database to another. It involves transferring data while ensuring its integrity, consistency, and availability. This article explores the challenges associated with data migration and provides detailed solutions along with sample code snippets. Challenges in Data Migration: Data Consistency: Ensuring that data remains consistent during the migration process is critical. Any discrepancies or errors can lead to incorrect results and data loss. Downtime: Minimizing downtime is essential to maintain business continuity. Prolonged downtime can disrupt operations and affect user experience. Schema Changes: When migrating to a new database version, the schema might change. Adapting the data to fit the new schema while preserving relationships can be complex. Data Volume: Handling large

Using Apache Avro for Efficient Data Serialization

Introduction In the world of software development, efficient data serialization plays a crucial role in enabling smooth communication between different components, systems, and applications. One popular technology that addresses the challenges of data serialization is Apache Avro. Avro is a powerful and versatile framework that offers a compact and efficient way to serialize data, making it an ideal choice for various scenarios. In this article, we will explore the need for efficient data serialization, the problems it helps us solve, and how to use Apache Avro with Java, using a "Product" entity as an example. The Need for Efficient Data Serialization Modern software systems are often composed of multiple components running on different platforms and communicating over various protocols. This communication involves sending data between these components, which can be in different formats and structures. Data serialization is the process of converting complex data str

Upgrade from http1.1 to http2 for Java spring boot applications hosted in tomcat

In this post, we will list down the tasks to be done for enabling the HTTP 2.0 support in spring boot applications which are hosted in Apache tomcat webserver Application Level Changes Spring boot Application Configuration Changes server.http2.enabled=true In the spring boot application's application.properties file, we have to add the above line so that Spring boot can add the support for http2 Tomcat server configuration In the tomcat web server, we should have SSL enabled before doing the below change. To start with, we have to shutdown the tomcat server instance that is running CD to the directory that has tomcat installed and cd to the bin directory and run the below command sh shutdown.sh We have add the UpgradeProtocol  which adds the respective Http2Protocol handler classname to the connector pipeline that enables support for http2.0 <UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" /> The above UpgradeProtocol can be added to the connec

Helpful functions from org apache commons collections

Introduction There are times when we are faced with the option to get the intersection of 2 lists. The type of list can be either a simple type like number / strings or a complex type like Object. This might involve developers building loops and performing comparison. This can be resulting in not following the DRY principle where we do not have to repeat ourselves what is already implemented. We can leverage the functionality provided in the collections4 library which can help us get the desired result. In this example, let us consider the following example.  Sample Scenario We can consider a "Cart" store which keeps track of the various items that we have added the cart. Every addition or deletion of the item to the cart needs to be updated. User's normally add some items and when they find out that their product of interest has its availability, they would want to add that to the cart and balance out by removing a lesser priority item. Now, when the user proceeds for th