goInterLock is cron-job/Schedule tasks with a centralized locking mechanism for Go (AKA Golang).

In the distributed systems, the lock prevents the tasks to been executed in every instant that has the scheduler.

For example, if your application has a scheduled task of calling some external APIs or doing some expensive DataBase querying every 10 minutes, the lock prevents the process to be run in every instance of that application, and you ended up running that task multiple times every 10 minutes.

Use case:

  • Kubernetes
  • Docker Swarm
  • AWS ECS Fargate

Quick Start

go get github.com/ehsaniara/gointerlock

Supported Lock

By Using Kafka we can easily horizontally scale our application to do asynchronous pagination in ElasticSearch.

Let’s say you have an ElasticSearch Index of 1,000,000 documents and you need to run an operation on those documents.

We already know how expensive the deep-paging in ElasticSearch is, especially index.max_result_window and doing Search ‘from:’.

GET /_search
"from": 5,
"size": 20,
"query": {
"match": {
"user.id": "jay"

One way of overcoming the problem is to use search_after.

With the help of this maven-plugin, you can create your own private Maven Repository with the essential features. There are many commercial products out there, for example, Nexus, JFrog, and etc.., but the drawback is they required more resources (compute and storage) and some are costly. Where you can simply set up in your AWS cloud with much much less cost.

In databases, change data capture (CDC) is a set of software design patterns used to determine and track the data that has changed so that action can be taken using the changed data.

In this example, I’m going to demonstrate the scenario in which you are going to capture data changes from Postgres (Logical Replication enabled) into the Kafka cluster.

Postgres Database — Kafka Connect — Kafka

A little intro to Strimzi:

Strimzi is an open-source project that provides container images and operators for running Apache Kafka on Kubernetes and OpenShift. You can find more information on strimzi.io

A little intro to Debezium:

Debezium’s PostgreSQL connector captures row-level changes in the schemas of a PostgreSQL database. PostgreSQL…

In this page I’m going to explain, How your spring boot application can interact with multiple data-sources not necessarily same type (Postgres for this demo) But it can be applicable across the other relational databases. There are cases that you need to have multiple datasources from different vendors, but the general concept is similar, and this example can be useful with little bit of changes in the project configuration (application.yml)

For this demo I choose PostgresSql Data Replication case, which is common in high load database with high traffic in Application.

There are times that even having the best DataBase…

Jay Ehsaniara

Software Engineer

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