Microservices: understanding what it is and its benefits
Until about 2013, companies usually built enterprise software by constructing applications as single units with large codebases, a monolithic architecture. As software became more complex and cloud computing gained popularity, this approach became less practical.
The advent of software-as-a-service products (cloud-delivered applications) allowed companies to use providers, such as Amazon Web Services, to create new servers and add redundancy quickly. This ensured that services stayed online during upgrades. It also ushered in a new era of velocity and agility. Users began to expect quick upgrades and improvements, prompting companies to change their development processes.
Companies began to break applications into smaller, independent services or microservices. For example, instead of including a messaging inbox as part of a monolithic e-commerce platform, they might create a separate microservice for this functionality.
In parallel, developers started working in smaller, more specialized groups that modified and improved individual services without risk to the entire application. These groups often took responsibility for the operations of their code, as well — a model called DevOps. To facilitate these changes, project managers began to develop new methodologies, such as Agile, which divides projects into smaller, more frequent releases.
Read on to learn more about the anatomy of microservices-based applications. Also, discover how Atlassian’s Compass reduces complexity while allowing developers to reap the benefits of this architectural model.
What are microservices?
A microservice is a function responsible for a single piece of logic (except for domain microservices, explained below). Multiple microservices combine to create distributed applications, such as Jira Software.
There are three types of microservices:
- Domain microservices loosely couple services with related functionality.
- Integration microservices facilitate interaction between unrelated applications.
- Unit-of-work microservices handle singular functions.
Microservices interact with each other using application programming interfaces (APIs). Developers working on individual services can learn the internal workings of the other microservices, which is another advantage over monolithic architecture.
Microservices-based architecture offers many benefits but also adds complexity. That’s why Atlassian developed Compass — to help companies simplify as they scale. This developer experience platform brings all the information about engineering output and team collaboration together in a central, searchable location.
Key principles of microservices
Microservices-based architecture has several distinguishing features. Developers can develop and deploy their services independently using the languages and technologies that suit their components.
Communication between microservices is API-based, allowing access to data from various sources without modification. Individual services can scale based on demand, saving costs and ensuring availability.
These attributes make microservices-based distributed applications flexible and easy to maintain.
Benefits of microservices
Microservices provide many advantages. They simplify development and project management. Sometimes, they may eliminate the need for separate operations teams since developers can handle operations for the microservices they build.
Some other benefits of microservices include:
Resilience and fault isolation
One error affects the entire application in monolithic architectures. But microservices are independent. One failure won't affect the other parts of the application.
Agility
Breaking applications into smaller chunks speeds up development. It allows teams to build, test, and deploy software more rapidly.
Technology diversity
Microservices allow developers to choose the right tools and technologies for the job. This increases efficiency and productivity.
Improved maintenance
The ability to test individual components makes finding and fixing bugs easier without taking the entire application offline.
Challenges of microservices
Microservices-based architecture has many benefits, but it also comes with challenges.
One challenge of microservices is that the independent services generate their logs. This is a disadvantage compared to monoliths' centralized logs, which provide a single source of truth for developers and operations teams. Monitoring and infrastructure management are also more complicated since many moving pieces exist. Testing and debugging are challenging because, unlike monoliths, no integrated development environment (IDE) exists.
Atlassian's Compass can help with all these challenges. Compass facilitates collaboration and allows companies to manage the complexities of distributed architectures as they scale. It does this by bringing the disconnected information together in a central, searchable location.
What is microservices architecture used for?
Large consumer websites often use hundreds or thousands of microservices. Microservices are particularly helpful in the following use cases and industries:
- E-commerce sites like eBay use separate microservices for shopping carts, mobile apps, and messaging.
- Financial institutions like Bank of America use microservices to communicate with outside services. They also use them to handle functions such as user authorizations and displaying transactions.
Social media platforms like Instagram and Facebook use microservices to display users' news feeds, messages, notifications, and friend networks.
Best practices for managing microservices
Over the years, developers have created dozens of essential best practices for microservices development. Below are just a few examples:
- The single-responsibility principle (SRP) specifies that each module or microservice should have only one function. The SRP continuous integration (CI) is a source-code control methodology that automates code quality checks before merging into a project, enabling velocity by eliminating the need for a separate QA process. This DevOps best practice helps velocity. CI precedes continuous delivery (CD), which runs automated building tools to keep software ready to deploy.
- API Gateways simplify communication between microservices, manage authentication and authorization, and boost security.
- Asynchronous communication between microservices preserves autonomy, reducing dependencies that might slow application function.
-
Versioning microservices is critical when developers implement breaking changes, such as removing an entire operation. This practice smooths transitions and minimizes the likelihood of service disruption.
Atlassian’s Open DevOps, powered by Jira Software, makes it easy for teams to automatically integrate Atlassian and partner tools, allowing them to focus on building and operating software.
Manage your microservices architecture better with Compass
Atlassian's Compass is a developer experience platform that brings distributed software architecture and teams collaborating in one place. It provides a convenient overview of all the components and services a team works on. It also includes a software component catalog to help developers easily find what they want.
Compass allows for easy component management, ownership tracking, and relationship monitoring. It also keeps track of changes in real-time.
Integrating Compass into your development environment is simple because of its customizable UI and compatibility with internal and third-party tools. Learn how to manage your microservices architecture with Compass and how it brings disconnected information together in a unified, central location.
Microservices: Frequently asked questions
What tools do people commonly use in microservices?
Businesses often use containerization tools such as Kubernetes and Docker. They also frequently use API gateways between microservices and their clients. These gateways perform API traffic functions such as authentication, access control, and load balancing.
How do microservices differ from monolithic architecture?
Monoliths are large codebases that function as one system. They require system downtime for updates and debugging. Microservices architectures are distributed applications with smaller, independent chunks of functionality. Developers can upgrade, improve, and debug these modules without taking the entire application offline. This simplifies scaling and aids development velocity.
How do microservices impact DevOps?
Those who understand DevOps know that continuous integration and continuous delivery (the DevOps CI/CD pipeline) are the mainstays of DevOps methodologies. The modular nature of microservices aligns perfectly with this approach. Microservices empower developers to swiftly create, test, and deploy small, frequent releases.
Join the Atlassian Community for more microservices articles and discussions.