In this post we explore two distinct approaches to software architecture: Monolithic and Microservice.
We'll break down their characteristics, weigh their pros and cons, and provide practical examples from our storage ecosystem. Let's dive into how these architectures work and consider our own journey from a monolithic setup to a microservice-based approach.
Consider a grand piano, where a broken string can render the entire instrument out of tune. This is like a monolithic architecture, unified but overall vulnerable to a single flaw. Now imagine an orchestra, composed of many musicians; if one instrument fails, the music plays on with minimal disruption. This is much like a microservice architecture, composed of autonomous, adaptable parts that make the overall system more resilient.
Example of Monolithic System In a monolithic system, a user accesses the system through a web application that interacts with an API and a database. This setup creates a single point of failure; if the API is down, the entire system is down.
Example of Microservice System In a microservice system, the application is broken into multiple services, each with its own database. If one service fails, the rest of the application can still function, eliminating single points of failure and enhancing system robustness.
Currently, our system is a hybrid between monolithic and microservice architecture. We have multiple front-end applications but a monolithic API. This means if the API goes down, all applications go down. Extending our legacy code is challenging and often results in breaking other systems.
We are planning to transition to a microservice architecture. This involves splitting the current monolithic API into smaller, independent services. Each service will have its own database and communicate with others as needed. This design aims to improve fault isolation and scalability while reducing single points of failure.
We plan to use the Strangler Fig Pattern for transitioning. This involves incrementally migrating from the legacy system to the new system by building new microservices alongside the existing system and gradually phasing out the old code.
We are exploring Dapr (Distributed Application Runtime) to handle service-to-service communication and other microservice challenges. Dapr acts as a sidecar to your application, simplifying the development of scalable microservices by managing infrastructure concerns. Stay tuned as we continue to share our experiences and insights on this journey of transition over our architecture!