Practical Asynchronous Java

Become a master in asynchronous workflows with Java by using well-known libraries and techniques


What you’ll learn

  • Understand why we need asynchronous programming in general.
  • Understand how to design an asynchronous application.
  • Understand how async primitives work in Java (Completable Future).
  • Understand how to check if an asynchronous application uses the threads efficiently.
  • Understand the tradeoffs of asynchronous applications.
  • Use asynchronous libraries to access databases in an async way.
  • Build end-to-end asynchronous REST APIs.
  • Understand how to monitor Thread-Pools and check if they use resources properly.
  • Connect the concepts learned in this course with real-world projects.

Course Content

  • Introduction –> 1 lecture • 7min.
  • General Concepts around Asynchronous Programming –> 3 lectures • 17min.
  • Asynchronous Programming in Java with CompletableFuture –> 8 lectures • 1hr 36min.
  • Building an Asynchronous REST API with SpringBoot –> 6 lectures • 1hr 2min.
  • Fetching data from a database asynchronously –> 3 lectures • 33min.
  • Monitoring ThreadPools in Asynchronous applications –> 3 lectures • 31min.

Auto Draft



This course is the best online resource you need to become proficient in building asynchronous code in Java, by learning to work with Completable Futures API, by building non-blocking workflows in REST APIs with Spring-Boot, by fetching data from databases asynchronously, and also by learning to monitor Thread-Pools to see if they’re used properly in your applications.

The goal of this course is to make you deeply understand the main asynchronous concepts (that can be re-used in many other languages), applied and exemplified in Java, the language used by many large companies and more than 9 million developers around the world.

About myself

I wrote my first line of code 10 years ago when I was in highschool. I quickly got addicted by how easy you could build useful programs using C# and Windows Forms.

I followed the Computer Science University track where I managed to set the ground knowledge for anything related to Software Engineering (Algorithms, Data Structures, Operating Systems, Multithreading, Distributed Computing, Networking, and many other topics), and I finalized this amazing 6-year learning path by getting a Master’s Degree in Parallel and Distributed Systems where I built from the ground a custom Kubernetes Gang Scheduler optimised for running Spark Jobs.

Currently, I’m a Senior Software Engineer focused on large-scale JVM-based development. I build code used by millions of people around the world.


Why I built this course?

Having experience with asynchronous code is a must for any Software Engineer who wants to step into a Senior role. I saw many people struggling to understand things like:

  • Why is my application stuck? How can I debug it?
  • How can I run this method on a different thread?
  • How do I know if my async application is using the resources efficiently?

It was really hard for me too to understand some of those things, even if I had enough university background in this area.

But fortunately, after many years of working with threads, callbacks, thread-pools, many trial and errors, many profiling sessions and books & articles read, I managed to deeply understand those critical concepts and use them properly in my daily job.

For those reasons, I thought that building a course where I expose my understanding on asynchronous workflows, would definitely help other people to save time and avoid going into the same pitfalls that I went through.


What is the content course?

This course is split into 5 chapters and each one will learn you a new angle of applying asynchronous code in your applications:

  • Chapter 1 – General Concepts around Asynchronous Programming
    • In this chapter we’re going to learn the basics of asynchronous programming – what we refer to by “async” (with some really cool examples), we’re going to clarify a common confusion – which is the main difference between parallel and asynchronous, and also we’re going to learn about the tradeoffs of async programs compared to the traditional programming, because there are also some aspects we need to be aware of.
  • Chapter 2 – Asynchronous Programming in Java with Completable Future
    • This is the first chapter in where we’re going to go hands-on by learning about the Completable Future API – how it differs from a classical Future, how can we deal with exceptions, and also how we combine multiple futures together to execute more complex scenarios.
    • Finally, we’re going to build an asynchronous trading bot, where we apply all the things we learned, in a very interesting project.
  • Chapter 3 – Building an Asynchronous REST API with Spring-Boot
    • In this chapter, we’re going to shift gears and explore the Spring-Boot framework, with an emphasis on building Asynchronous code (with @Async annotation), and we’re going to also configure the asynchronous mechanism by changing the underlying thread-pool where @Async annotated methods execute.
    • In the end, we’re going to build a very interesting project, which is a fully async REST API that downloads images from an external system, based on a keyword provided by the user.
  • Chapter 4 – Fetching data from a database asynchronously
    • Data access is a very important aspect, mostly in asynchronous applications, where flows need to be async end-to-end. It doesn’t make sense to handle a request asynchronously, but fetch data in a blocking fashion.
    • For that reason, in this chapter we’re going to explore non-blocking database clients for MySQL and Redis, that should be used in any async application, to properly build a data-access workflow.
    • In the end, I left an exercise for you to explore the async data-access process for Mongo DB, which will be really interesting to follow.
  • Chapter 5 – Monitoring ThreadPools in Asynchronous applications
    • In this last chapter I’m going to show you how to properly monitor a ThreadPool using Prometheus and Grafana (a well  known Open Source monitoring stack).
    • We do that by first understanding why monitoring thread-pools is important, by building and configuring the monitoring stack with Docker, and finally by instrumenting our Spring-Boot application to expose metrics in a Prometheus format.

What are the requirements for this course?

  • Basic Java Knowledge (including Object Orientated Programming)
  • Basic Java Multithreading concepts are a plus, they’ll help you to grasp the concepts of this course faster
  • An IDE of your choice, ideally IntelliJ Idea Community Edition, but you can use any IDE where you can run plain Java code
  • Willingness to learn and an open-mind


Thank you for taking the time to look through this description and I’m looking forward to see you in the first lecture!

Get Tutorial