Micro-services are a great way to build scalable applications. Each service is instantiated the number of times which is best suited to manage the workload. This is especially relevant for cloud-based deployments where you pay as you go and don’t want to run any unnecessary virtual machine instances.
JAVA is the most used development language in some key areas of our economy such as banking. Despite the recent competition of .Net Core and the changes in its licensing strategy, JAVA is still widely used by the largest organizations. On the cloud front, Azure has established a strong position on the large enterprises and public sector markets, especially in Europe.
Azure might seem linked to .Net due to the history of Microsoft. In fact it’s not. It’s possible to deploy JAVA micro-services on Azure, and there are several ways to do it. Azure isn’t more linked to .Net than it is to Windows. From our own experience we have learned that it is very easy to perform Azure administration on a Mac.
Here are three ways to deploy JAVA micro-services in Azure:
1) Use Azure as an IaaS (Infrastructure as a Service) provider
That’s the first idea that comes when wanting to deploy micro-services on Azure: “deploy a micro-services solution on Azure VMs”. For sure this way any off the shelf solution will work, Azure just acts like any other cloud compute solution and will be the exact replica of what you would have setup on your own server farm.
There is not much to say about it, except that you will have to manage absolutely everything
2) Use AKS (Azure Kubernetes Service)
AKS is a PaaS (Platform as a Service) Kubernetes solution, or serverless Kubernetes. This allows to orchestrate containers as a cloud service, eliminating the need for managing infrastructure elements. In practise Kubernetes VNet, Load Balancer, VMss, nodes and network interfaces are still present but their management is fully integrated.
In this case you build your classic JAVA microservice, for example using Spring Boot, and package it in the container that will be orchestrated by Kubernetes.
- You don’t have to manage servers anymore
- You don’t have to manage Kubernetes by itself
- Your development pipeline can integrate the containerisation
- The serverless container hosting is scalable
3) Use ASF (Azure Service Fabric)
ASF is a PaaS micro-services solution released under open-source license by Microsoft. Unlike Kubernetes, this is a micro-services oriented solution, not a generalist one. With ASF, you don’t deal with containers, just with services that will later be deployed on a cluster from a single command. Plus, ASF has en embedded in-memory database with cluster based resilience. ASF leverages the JDK and some ASF-specific libraries to fully replace the JAVA app server: your services does not need anything else to run (like the embedded Tomcat in Spring Boot).
- You don’t manage the deployment aspects, you just build services
- You can create stateless and stateful services thanks to the built in persistent in-memory DB that is replicated and persisted on all nodes
- You service logs can be accessed from a single place in Azure
ASF relies on the load balancers and “scale sets” of Azure to dynamically instantiate virtual machines that are automatically provisioned with the ASF stub and your code. Due to the extra services, there is a minimum VM size constraints.
Which option should I choose?
Choosing between options 1), 2) or 3) depends on many factors: reversibility and independence from a cloud provider, human cost of operations, workload. For example a stateful service engine (i.e.: that persists state between calls) will shine on high workloads because it offsets some load from the database, up to fully eliminating it on some specific use cases. We have built a real production application in two versions: one for ASF and one for Kubernetes (based on a Spring Boot powered container) and will be happy to discuss in detail the pros and cons!
And in all three cases, the creation of the IaaS or PaaS Azure resources can be fully automated and integrated as “Infrastructure as Code” with the help of our Cloudboost Library
You are looking to move to a cloud-based micro-services architecture and want to better understand what are your options ? Reach out to us and let’s discuss pros and cons of each option around a real business case. Demos, real configurations and example of code are worth thousands of slides!
About Francois Vaille
Formerly IT Manager, CIO, Managing partner in an IT company, Start-Up founder, François is an achiever, innovator, intrapreneur and entrepreneur. He helps Sogeti’s customer in their digital transformation thanks to his helicopter vision, from C Level to coders.
More on Francois Vaille.