Understanding the Differences Between FLOAT and DECIMAL Data Types in MySQL: A Case Study on Approximation Errors

A few years ago, during one of the dev testing, a fellow engineer complained that the total amount paid is not matching in API response. However, if we manually add the values in DB, it adds up to the correct amount. What could have gone wrong? As we went down the debugging path, we had... 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 →

Simple Project Idea in Java for Beginners

Problem Statement: Make a console based java application which support CRUD (Create, Read, Update, Delete) operations for e-commerce domain. Application should be able to support following features: Any user should be able to sign up, log in and log out. Admin should be able to add, update and delete products. Logged in user should be... Continue Reading →

A Beginner Tutorial For Elasticsearch – 1

Introduction Elasticsearch is a near-realtime search platform. Near-realtime means that there is a slight latency from the time a document is indexed until the time it becomes searchable. We will start with some terminology related to elasticsearch. Document A document is the basic unit of information that can be indexed. A document is expressed in... Continue Reading →

Why should we use explain command?

I used to spend long hours staring at screen and running load test again and again to reduce the latency of that problematic API. Then, doing some small changes here and there and relying more on God than myself for miraculous improvement. Can you connect to this? Voila! I learnt EXPLAIN. I am going to share... Continue Reading →

Optimizing MySQL Performance – An Introduction

What can a badly designed database do? Anyone whose bread and butter comes from database seldom underestimates database performance. But Paulo Cohelo said in veronica decides to die that, People never learn anything by being told, they have to find out for themselves. Echoing the similar sentiments, I was happily having breakfast, lunch and dinner until one... Continue Reading →

Dropwizard : Write Data Into Database Using Hibernate

Please follow the first two part of the tutorial before starting this: Introduction To Dropwizard Read Data From Database Using Dropwizard Modify InfoDao To Persist Data Add a method to persist data https://gist.github.com/rohitsingh20122992/804fcb8d8278697b9bad67dc4d6eb596 Add POST API to store the info https://gist.github.com/rohitsingh20122992/ba92da47d24be1cbff32ea19106e92b9 Test Your API Run your project. Test using postman or any other rest client.... Continue Reading →

A Short Introduction To Disk Storage

Introduction In a modern computer system, data resides and it is transported throughout a hierarchy of storage media. The highest speed  memory is the most expensive and therefore available with least capacity. The lowest speed memory is offline tape storage which is available in indefinite storage capacity. The storage capacity is measured in bytes, kilobytes,... Continue Reading →

Up ↑