Зміст курсу
Software Architecture Fundamentals
Software Architecture Fundamentals
Service-Oriented Architecture (SOA)
When applications grow too large and complicated, managing them as a monolithic system becomes increasingly difficult.
Service-Oriented Architecture (SOA) addresses these challenges by dividing the system into multiple independent services, each responsible for a specific business function. These services remain autonomous but work together to deliver a seamless user experience.
To facilitate communication between these services, SOA often employs an Enterprise Service Bus (ESB). The ESB acts as a middleware layer that enables different services to communicate with each other, regardless of their underlying technologies.
By centralizing communication, the ESB reduces the complexity of direct service-to-service interactions and allows for easier integration of new services into the architecture.
Why Do We Need SOA?
SOA solves several problems posed by monolithic systems:
- Flexibility: services can be updated or replaced independently without affecting the entire system;
- Scalability: services can scale individually based on demand. For instance, the order-processing service might need more instances during peak shopping periods;
- Maintainability: bugs or upgrades are easier to manage within smaller, independent services.
But there are also some important problems with this architecture. You can look at the following table to compare pros and cons of this type of architecture.
Example
In an e-commerce platform designed with Service-Oriented Architecture (SOA), the application is divided into multiple independent services, each responsible for a specific function. These services interact with each other through well-defined interfaces or APIs, enabling better scalability and flexibility.
-
User Service includes the UI module, which manages the user interface where customers can browse products, add them to the cart, and place orders. It also contains the product catalog module, responsible for handling product data such as names, prices, and availability, and sending this information to the UI;
-
Order Service handles the lifecycle of orders using the order processing module. It manages tasks such as inventory checks and updating order statuses (e.g., "Pending", "Shipped"). Additionally, it includes a payment module that processes payments securely and interacts with external payment gateways to complete transactions;
-
Data Service stores all essential data, including user accounts, products, orders, and payment records. All other services communicate with this database to retrieve or update relevant information.
Expected Dataflow
The User Service delivers the UI and displays products using the Product catalog module.
Once the user places an order, the Order Service takes over. It uses the Order processing module to validate the order and then forwards it to the Payment module for secure payment.
After successful payment, the Order Service updates the status and stores the order details in the Database, part of the Data Service.
Дякуємо за ваш відгук!