The Ultimate Guide of Microservices Technologies for Java Developers

cloud-computing
cloud-computing

The Java Market Some Time Ago

Not long ago, Java developers had to be very good at Java (of course), Java EE or Spring technologies, and some front-end technologies such as JSF, Angular, React, SQL, and databases. Some architecture and modeling knowledge was also great to have.

Some time ago, microservices were the fancy thing, only a few companies were adopting them, and not so many developers were working with them. However, nowadays, this reality has changed. Almost the whole market is adopting the use of microservices architecture even when it’s not suitable.

In the last two years of my career, I’ve been mostly doing DevOps work, gluing things together, monitoring data, creating security certificates, logs, infrastructure scripts, storing secret keys, and so on.

The microservice architecture is the new default of the market. More and more developers already know most of the microservices technologies. However, it’s overwhelming for developers who only know about monolith technologies to jump to a microservice architecture and be exposed to the number of technologies we have to know.

To make my point, I’ve made a research on my Twitter and 64.10% of Java developers are also mostly doing DevOps work:

java-market

To make the life of Java developers who are not used to the microservices environment easier. I will give a macro view of all technologies I’ve been using so that you can have a direction of what to study/practice.

Microservices in simple words

Microservices is an architecture to break down a project into isolated services that don’t depend on each other to work. We deploy microservices in the cloud. Therefore developers need to have infrastructure knowledge since the DevOps culture defends the idea that developers should own their service from development to deployment into the production environment.

Usual Microservices Technologies

Containers

Docker – It’s a container technology responsible for containerizing applications into an isolated environment where is portable and easily deployed on any platform.

Kubernetes – It’s a container orchestrator technology that deploys a Docker container, for example, into cloud providers such as AWS, Oracle Cloud, Azure, or Google Cloud.

Helm – It’s a package manager for Kubernetes that enables developers to deploy and manage complex applications.

Harbor – It’s a technology that enables developers to manage artifacts in a secure and manageable way across cloud-native platforms like Kubernetes and Docker.

Security

Vault – Responsible for storing credentials and secrets in secure storage that can be retrieved by microservices.

OAuth – It’s a framework to delegate authentication to other services, we see that very often when we need to create our account on a website, and we have the option to authenticate by using Google, Facebook, Github, OneLogin and so on.

OWASP – It’s an online community that provides documentation, methodologies, tools, and frameworks to keep an application secure from code vulnerabilities, a widespread example is SQL injection, cross-site scripting, and so on. A tool I used to analyze and detect vulnerabilities in code was HP Fortify, but I don’t think this tool is popular in the market anyway.

KeycloakIt’s an Identity and Access Management solution aimed at modern applications and services. It makes it easy to secure applications and services with little to no code. It’s also possible to use the single sign-on concept with Keycloak, which is very handy since we don’t want to authenticate several times for each microservice.

Cognito – If you don’t mind using specific cloud vendors, technology Cognito might be a good option.  Amazon Cognito provides authentication, authorization, and user management for your web and mobile apps. Your users can sign in directly with a username and password, or through a third party such as Facebook, Amazon, Google, or Apple.

HTTPS SSL/TLS – To secure your application in the cloud and encrypt information that is shared between services, we need to implement a solution to make HTTPS requests instead of HTTP.  We also need to generate certificates to ensure the HTTPS endpoint is secure.

Infrastructure as Code

Terraform – To run services in the cloud. We need to configure a set of cloud provider services if we do all this process manually, we might lose control of a complex cloud environment. In case we move to another cloud environment, we would have to configure the whole environment again manually, which is not ideal. With Terraform, we can write all the configuration we need in the cloud, and then by running one command, we can set up a whole cloud infrastructure. Another benefit is that we can keep our infrastructure code in a repository, and then we can more easily understand how the cloud environment works.

Cloud Formation – It does the same thing as Terraform but only works for AWS; it’s known to be more verbose and hard to maintain. Also, it’s not cloud-agnostic.

Infrastructure as a Service (IaaS)

AWS Amazon Web Services – It’s the most popular cloud provider in the market; it is the most complex to be mastered. Still, it’s continuously evolved and has a vast array of options, and it’s highly flexible. There is a free tier where you can run your tests for one year.

Google Cloud – Compared to AWS, it has fewer features, but on the other hand, it’s simpler to get started and to deploy and manage your application. You also have a credit of approximately $300,00 to play around for free.

Oracle Cloud – It’s an optimized, fast cloud provider that gives you the possibility to use your services forever free in a service instance. It’s also a mature and reliable cloud provider.

Microsoft Azure – It’s robust and easy to set up and developers have around $200,00 to play around, and run their tests.

Software as a Service (SaaS) – It’s software that solves a specific company need, it’s ready to be used and you don’t need to worry about anything rather than use it.

Platform as Service (PaaS) – It’s a cloud platform where developers don’t need to understand infrastructure concepts in-depth to run their applications in the cloud. Examples of PaaS are AWS Elastic Beanstalk, AWS Lambda, Google App Engine, Google Cloud Functions, and so on.

Feature flags

Launch Darkly – Considering that the idea of the DevOps culture is to deliver software constantly, there will be situations where we will create features but those features won’t be fully done, therefore we can’t deliver the feature to production, then we can simply disable this feature by using Launch Darkly. There are other possibilities, such as using feature flags for A/B testing as well.

Automation

Jenkins – Automate the build, test, deploy code analysis processes by using Jenkins.

Code Repository

Git – It’s by far the most used code repository manager in the industry, we should learn the basic commands to manage our code in the repository.

Data Monitoring

Prometheus – Everything in software development is a trade-off, with microservices is no different. Debugging microservices is far harder than using a monolith, we have to deal with service interactions in the cloud, therefore, debugging doesn’t help us much. Instead, we have to use a tool for monitoring software processes. Prometheus is an open-source project and is built to be used with Kubernetes.

Datadog – We can view infrastructure metrics, traces, and logs all on the same dashboard. Datadog supports visualization, troubleshooting, monitoring, and alerting. Datadog is a paid product that helps to understand what is happening in the microservices, and where is the bottleneck, it helps us to measure the availability of our services and how to troubleshoot possible problems that might occur.

Deploy

Blue/Green deployment – It’s a strategy to maintain an application available as much as possible, if the new deployment goes wrong, the old deployment will take over.

Canary deployment –  It’s a way to load balance deployments so that it’s possible to perform A/B testing. With the canary deployment, it’s possible to direct 80% of users’ traffic to the stable version of the software and the other 20% of the traffic to use a new marketing strategy for a company for example so that the company can test their strategies in a more reliable way.

Is it over? No, there is more!

Other than all those DevOps technologies there is software implementation and when we are working with microservices, there will be usually four languages in the company we are working on.

Therefore, if we are working with Java, we should know a lot or at least how to solve problems with it:

Spring
Quarkus

Jakarta EE
Dropwizard

We should also have an idea of the following languages,

Python
GoLang
Kotlin
NodeJS 

For the front-end, the hottest technologies are:

Angular
React
VueJS

It’s not over yet, there are also tests!

Unit Tests – When we test each method in an application separately. The advantages of Unit Tests are that we can develop a more optimized code and it runs really fast.

Integration Tests – It’s a test that is usually integrated with the database or any other external resource, it’s great for fixing bugs more quickly.

Canary Tests – It checks if all external resources are working such as databases, connectivity with network, and data integrity.

Smoke Tests – It tests a very crucial and strategic part of the system.

End-to-end Tests – It will test an application from the front end to the back end, it’s great for testing uses cases.

What to do then since there are so many technologies to learn?

We should know enough about those technologies so that we can at least solve problems with them. Then, we can also use the ‘just in time learning’ technique, we learn enough to go forward.

One very effective way for you to get used to web services technologies is to create a personal project of yours and deploy it into a cloud provider using the mentioned technologies above.

Leave your comments about how you feel about those technologies we have to learn in the cloud era and leave your guess for the next biggest change in the software development industry!

Written by
Rafael del Nero
Join the discussion

2 comments