Storing and querying non-overlapping ranges using one of NavigableMap implementation

Photo by veeterzy on Unsplash

As soon as you hear word TreeMaps, you always remember that it is a map type that can iterate keys in order. In this article, I will show you that TreeMap can actually do a little bit more than that in some different scenarios, such as, when dealing with ranges.

Have you ever faced scenarios where you want to get the corresponding falling range for a given value? For instance, the range [10, 20], providing any number between 10 to 20, inclusively, should return this range, or range’s associated value. Hypothetically, think you are writing a just-another-static-analytic-tool and you want…

Using Window Functions

Photo by Daniel von Appen on Unsplash

Believe me, SQL’s window functions are one of a powerful feature I have seen in the database world. it excels especially when you want to query analytic information. The provided syntax in this article is on MySQL, and MySQL began supporting window functions since version 8. Before MySQL 8, I had to write a lot of business logic in order to get some analytic data out of the database.

Let’s dive into the window functions by using an example, so you will able to grasp the power of this feature easily. Let’s create leaderboards with rankings for a simple game.


Photo by Samuel Zeller on Unsplash

What is a cloud native application?

A cloud native application is a kind of service application that can be run on cloud containerized environments. Cloud native applications are generally being used in microservices, though it does not restrict to it.


As somebody said, cloud means someone else computers. Organizations are moving to cloud, purely because maintaining infrastructure in somewhere else under a SLA is better and cheaper than maintaining by themselves.

Today cloud environments are designed to run with containers. Containers are popular, because it removes the environment mismatch between what the program is required and what cloud vendors provide…

Java is a statically typed language, and then there are generics.

Photo by Pritesh Sudra on Unsplash

Recently I was experimenting with Flink, which is a stateful stream processing framework, to create a small stream pipeline for one of my applications. When defining streams and its operators, it uses static typing extensively to prevent runtime failures, hence leading to reliable execution handling. Not so surprisingly, its programming model is heavily built on top of generics.

Java generics is all about providing type safety. It allows creating reusable types composing other types as parameters. Or, in coding terminology, it prevents accidental ClassCastException when dealing with type parameters.

“photography of excavators at mining area” by Dominik Vanyi on Unsplash

Java is and has been undoubtedly the leading programming language for enterprise applications. I believe it is mainly because of the maturity of Java Virtual Machine (JVM). JVM is there for around more than 20+ years, and it is considered as one of the most reliable and optimized runtime engine ever created. In a nutshell, it has the most experience level among other application runtime engines.

Dealing with Java classloaders are considered only for advanced users due to their inherent complexity. Sometimes you hardly, or probably ever, have to deal with classloader workings in your coding career. …

Isuru Weerarathna

Love Coding | R&D | TL | DevOps | Love Books

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store