You learn a lot by giving back

Image for post
Image for post
Photo by Carli Jeen on Unsplash.

After several years of working in development, I think many feel a call, a need to transmit what they’ve learned during their time as a software developer.

With your struggles to master a particular skill in mind, it’s awesome to transmit your knowledge and make things easier to learn for others.

Some months ago, I had the opportunity to teach a Java course. I was very curious. I think many of us are engaged in some form of teaching with colleagues, explaining our code or our approach to solving a particular problem. …

Image for post
Image for post
Photo by Layne Lawson on Unsplash

Why caching is so important?

When building microservices applications, it’s very important to pay attention to I/O operations, to avoid overhead. By definition, microservices are applications that exchange continuously information via HTTP or other protocols, and this can cause delays. Use a cache may reduce the service’s load making operations faster, avoiding useless HTTP requests.

What is Hazelcast?

Hazelcast is a great In-Memory Data Grid, for storing data across services and nodes, easily scalable with great auto-discovery functions. It’s written in Java and it could be run side by side your application or deploying a purpose service for it.

Hazelcast is very similar to Reddit, but the company…

Image for post
Image for post
Photo by Markus Spiske on Unsplash

In the last years, Cybersecurity history becomes part of modern history and it’s important we know it, to understand how to be protected on the web and how to build safe systems.

In this article, I want to highlight stories about cybersecurity, and what we can learn from them.

Ashley Madison data breach

It’s a dating website for married/engaged people. In 2015, a group called “The Impact Team” stole the entire database of 33 million users, including those who paid 19 dollars to request the physical cancellation of the profile.

Despite the efforts of the company to remove data from the web, they kept…

Image for post
Image for post
Photo by Mohamed Nohassi on Unsplash

When building real-time applications based on data-streams is important to build non-blocking systems. If you are not familiar with these concepts it’s important to focus on data and operations we wan to perform on them.

In this example, we are building a piece of application that will submit notifications to mobile devices using Firebase APIs. This will perform only I/O-bound operations so the Reactive-programming approach sounds the best solution.

What is Reactive Programming?

It’s a programming paradigm based on data streams and the propagation of change, this means we are working on a dataset and we will perform operations only when an event is…

Image for post
Image for post
Photo by Nikhita Singhal on Unsplash

What is a Hash function?

It’s an algorithm that maps an input of arbitrary length to a unique output of fixed length, this value is known as HASH, FINGERPRINT or DIGEST.

It is usually used to verify the integrity of data, in fact, digital signature algorithms are applied to the DIGEST and not to the entire document.

What are collisions?

Every input of HASH functions supposed to be mapped to a different output (DIGEST) but this is not always true, it’s possible to find two messages that may produce the same result, in this case, we have found a collision. …

Image for post
Image for post
Photo by Soraya Irving on Unsplash

Generics methods and classes allow programmers to write a single method or class gentrified to work with different types.

We use them every day think to List<T>, Stream<T>, Map<K, V>

A generic class is a normal class with the class name followed by a type parameter section. These classes are known as parameterized classes or parameterized types because they accept one or more parameters.


  • Type-safety: We can hold only a single type of object in generics.
  • Typecasting is not required: There is no need to typecast the object.
  • Compile-Time Checking: It is checked at compile time so the problem…

Image for post
Image for post
Photo by Biegun Wschodni on Unsplash

Spring Webflux is a recent version of Spring refactored to allow building non-blocking applications using the project reactor. The main difference is the application server: with Webflux your application will run under Netty which is the “Asynchronous event-driven network application framework”, instead of Tomcat.

Reactive programming

If you are not familiar with this kind of programming approach, you have to know we are building applications based on data-stream and propagation of events/changes of data or conditions.

Project Reactor

It’s an interesting framework that brings reactive programming in Java after javaRx. The pillars of this library are two classes:

  • Mono<T> — is a publisher that…

Image for post
Image for post
Photo by Denys Nevozhai on Unsplash

When building an application based on real-time data streams, it’s fundamental to have a highly responsive system that can handle the highest number of messages. The most common choice is to use a producer-consumer solution using messages broker like Rabbit.

These types of solutions are cloud-based with numerous consumers ready to scale if the load in the queue grows too much. …

Image for post
Image for post

InfluxDB is an open-source database built for time-series data and written in GO. It is easy to install it’s enough to run a docker container with no other dependencies, although full power can be unleashed using all the TICK suite(Telegraf, Influx, Chronograf, Kapacitor)

Skipping presentations Influx is a very goodly distributed NoSQL database, but don’t worry you will be able to write SQL-like queries.

Data structure

Influx offers a data-structure similar to a SQL DB :

  • Measure: it’s like a table and the primary key will be the timestamp.
  • Point: it’s comparable to a row in an RDBMS, it indicates the measure…

Image for post
Image for post

Gitlab CI/CD is the process of automating the build and testing of code every time a team member commits changes to Gitlab. Committing code triggers an automated build system to grab the latest code from the shared repository and to build, test, and validate the branch.


  • Gitlab
  • Linux server with SSH access
  • Docker registry
  • Gitlab-runner (if working on-premise)

How it works

Every time someone pushes on a branch of your repository, a pipeline will be triggered on a dedicated virtual machine running jobs described in .gitlab-ci.yml file.

Writing gitlab-ci.yml

So let’s suppose we want to write a simple pipeline composed of…

Stefano Troìa

An Italian Java developer. More on my profile:

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