Delivering software through microservices is a modern development approach with many benefits, for developers and customers alike.
Using microservices means developing an application in separate, independent services. Users then access the whole application and its features through a front-end, unaware of the difference in delivery.
Despite the benefits, there are things to consider before developing in microservices, such as the software's structure and the team's processes. Thankfully, many microservices frameworks exist to help lift some of that load.
In this post, we look at:
Let's imagine you're building a retail website with microservices. You might decide to develop the following features as separate services:
Website front-end (HTML, CSS, etc)
Search
Navigation
Product database
Call to actions
Carousel
Website widgets (new, popular, or sale items, for example)
Customer product reviews
Checkout and payment systems
Support live chat
Compared to a traditional website delivered as one object, microservices offer the following benefits:
Product reliability - A problem with one component is less likely to impact your business. For example, people can still search and buy things if your customer reviews component goes down.
Quicker fixes - If the container with your checkout system becomes corrupt, you can replace it with a fresh image in minutes.
Reusable components - If you open a second retail website, both can share the same live chat feature.
Scalability - You can easily scale your website's resources to meet each component's traffic demands.
There are cost and network traffic trade-offs to consider, however.
If you want to deliver your product through microservices, there are many ways to plot out how it'll work.
You could start from scratch and feel out a simple product structure along the way with nothing but your code and some containers.
This approach is likely fine for small projects with few features, but things can get complex quickly if you need to scale suddenly. You could see a bunch of unintended impacts, such as:
The product being hard to troubleshoot
Risk of new team members struggling to figure out how things fit together
Finding dependencies you didn't know you had
This is where adopting an established microservices framework from the start makes things easier.
As the name implies, a framework is a ready-made architectural structure for software development. A framework:
Helps form the shape of your software as it lives on your infrastructure
Offers teams clarity and focus
Has tools to help with development
Helps everyone in your team pull in the same direction
Best of all, a framework saves you time in planning, development, and support. Frameworks are proven, well-worn paths to software delivery. Why spend time making mistakes or plotting structures when someone has already done that for you?
There are countless frameworks available for projects delivered in microservices. Those you consider will depend on your project and the programming language you use.
Let's look at a handful of popular framework options for different development languages. This isn't a comprehensive list, though. There are plenty more frameworks on the market, and we recommend doing your research before committing to one.
All these frameworks are open-source.
The Molecular microservices framework promises:
Koa is a microservices framework that claims to be leaner and more customizable than its predecessor, Express. It also aims to make server creation easier.
LoopBack 4 is a microservices framework that includes:
Micronaut is a solid option because of its compatibility with Java-like languages, such as Groovy and Kotlin.
It offers:
A microservices framework by AxonIQ that's suitable for development using:
A microservices framework from Java-framework provider, Spring.
Spring Cloud Functions boasts a framework that makes it easy to start small and grow.
Its Spring Cloud feature helps with connectivity with many service registries, and also offers an API gateway into your project.
They also offer optional metrics through Micrometer.
Specifically for Java developers who want to work with Kubernetes, Quarkus is a microservices framework meant for use with GraalVM and HotSpot.
Flask is a minimalistic but powerful microservices framework for Python-developed projects.
Falcon is a microservices framework that plays well with other Python frameworks.
It is:
As another lightweight Python offering, CherryPy claims to be as easy as its name.
It is:
Go Micro promises:
Echo promises:
Fiber's developers describe Fiber as a Go equivalent of the Express framework. Built on top of Fasthttp, it offers easy routing definitions and helps deliver static files.
ASP.NET is Microsoft's framework for building web apps and services. ASP.NET is especially useful for microservices thanks to its support of Docker images and the ease with that you can create APIs for each service.
In this post, we looked at microservices benefits, explored why using a microservices framework is a good idea, and listed some popular framework options.
We also have posts about containerization on the way, including:
Happy deployments!
Also published here.