In this post, I will give you an overview of Flyway, the database migration tool, and the steps needed to integrate it into your project.

## Mapping Between Domain & Data Transfer Objects With MapStruct

Multi-layered applications often require to map between different object models (e.g. entities and DTOs). Writing such mapping code is a tedious and error-prone task. MapStruct aims at simplifying this work by automating it as much as possible. In this post, I will give you an overview of MapStruct and the steps needed to integrate it into your project.

## A Quick Introduction to Redis HyperLogLog

A HyperLogLog is a probabilistic data structure used in order to count unique values. Mathematically it is defined as a probabilistic data structure to estimate the cardinality of a data set. Computing the count of distinct elements in a large data set is often necessary but computationally intensive. Say you need to calculate the number of distinct users visiting your website in the past week. Doing this with a traditional SQL query on a large data set would take a long period of time and a large amount of memory. But instead of exact count if an approximation is allowed we can achieve this in no time with a small amount of memory usage by using the HyperLogLog algorithm. In this post I’m going to give a quick introduction to Redis HyperLogLog.

## Count Unique in Druid Using DataSketches HLL Sketch

By leveraging the fast, approximate calculations of DataSketches, complex analytic queries such as cardinality estimation and retention analysis can be completed in less than one second in Druid. In this post, I’m going to show how to count unique or count distinct in Druid using the Datasketches HLL Sketch algorithm which is available as an aggregator in druid-datasketches extension.

## Count Unique in Druid Using DataSketches Theta Sketch

By leveraging the fast, approximate calculations of DataSketches, complex analytic queries such as cardinality estimation and retention analysis can be completed in less than one second in Druid. In this post, I’m going to show how to count unique or count distinct in Druid using the Datasketches Theta Sketch algorithm which is available as an aggregator in druid-datasketches extension.

## Getting Unique Counts from Druid Using HyperLogLog

Apache Druid is a high performance real-time analytics database. On the other hand, HyperLogLog algorithm, shortly known as HLL, is a very efficient way to add elements to a set and then estimate the size of that set. In this article, I will demonstrate how to get unique counts from Druid using the HyperLogLog algorithm. The details of HyperLogLog are beyond the scope of this article.