Backing Services for Cloud-Native Architectures

Mehmet Ozkaya
4 min readSep 3, 2024

--

We’re diving into the world of Backing Services for Cloud-Native Architectures.

Backing Services for Cloud-Native Architectures

Get Udemy Course with limited discounted coupon — .NET Backend Bootcamp: Modulith, VSA, DDD, CQRS and Outbox

We’ll explore what backing services are, why they’re essential for cloud-native apps, and how we can leverage them to build a robust modular monolith architecture for our EShop application. Let’s get started! 🚀

What Are Backing Services in Cloud-Native Microservices?

In a cloud-native architecture, backing services play a crucial role in supporting various functionalities that an application depends on. Let’s break it down: 🧐

  1. External Resources: Backing services are external resources or components that a cloud-native application relies on for its operation.
  2. Support for Functionalities: They provide support for functionalities such as data storage, messaging, caching, and authentication.
  3. Attached Resources: In cloud-native architectures, backing services are treated as attached resources. This means they are external to the core application but are essential for its functionality.
  4. Decoupled from Application: These services can be swapped or replaced without altering the core logic of the application, promoting flexibility, scalability, and easier maintenance.

By treating backing services as attached resources, we decouple them from the application itself. This separation is key to achieving a flexible, scalable, and maintainable architecture. 💡

Examples of Backing Services

Backing services are integral to the operation of cloud-native applications. Here are some common examples you might encounter:

Examples of Backing Services

1. Databases

Databases are essential backing services for storing and retrieving persistent data. They come in various types, including SQL and NoSQL.

  • SQL Databases: Examples include PostgreSQL and MySQL, which are used for structured data storage.
  • NoSQL Databases: Examples include MongoDB and Cassandra, which are used for unstructured or semi-structured data.

2. Distributed Caches

Distributed caches help in improving application performance by storing frequently accessed data in memory.

  • Redis: A popular in-memory data store used for caching.
  • Memcached: Another widely used distributed cache for speeding up dynamic web applications.

3. Message Brokers

Message brokers facilitate asynchronous communication between different parts of an application, decoupling them and allowing for more scalable architectures.

  • RabbitMQ: A message broker that supports multiple messaging protocols.
  • Kafka: A distributed streaming platform used for building real-time data pipelines and streaming applications.

4. Authentication Services

Authentication services handle user authentication and authorization, ensuring secure access to the application.

  • Keycloak: An open-source identity and access management solution.
  • AWS Cognito: A fully managed service for user sign-up, sign-in, and access control.

These backing services are integral to the architecture of cloud-native applications, enabling various functionalities while keeping the core application logic simple and modular. 🏗️

Backing Services for Our EShop Modular Monolith Application

Now, let’s see how we utilize these backing services in our EShop Modular Monolith application.

Backing Services for Our EShop Modular Monolith Application

1. EShop Modules Using PostgreSQL

In our EShop application, several modules rely on PostgreSQL for their database operations. This diagram illustrates the relationship between our modules and PostgreSQL:

By leveraging PostgreSQL, we ensure robust data management and high performance for our EShop modules. But PostgreSQL isn’t the only backing service we use. Here are a few others:

2. Redis for Basket Module

For the Basket module, we use Redis as a distributed cache. Redis helps improve the performance and scalability of the Basket module by storing frequently accessed data in memory, reducing the load on the PostgreSQL database.

3. RabbitMQ for Messaging

RabbitMQ is our choice for message brokering. It facilitates asynchronous communication between different modules, ensuring reliable message delivery and decoupling various parts of the application. This decoupling is crucial for maintaining flexibility and scalability.

4. Keycloak for Identity Module

For managing authentication and authorization, we use Keycloak. It provides secure access management across the application, ensuring that users and services interact securely.

Conclusion

In conclusion, backing services are vital for the operation and scalability of our EShop Modular Monolith application. By leveraging external resources like PostgreSQL, Redis, RabbitMQ, and Keycloak, we ensure our application remains modular, flexible, and scalable.

Get Udemy Course with limited discounted coupon — .NET Backend Bootcamp: Modulith, VSA, DDD, CQRS and Outbox

EShop Modular Monoliths Architecture w/ Catalog, Basket, Identity and Ordering modules

This is step-by-step development of reference Modular Monoltihs Architecture on .NET used ASP.NET Web API, Docker, PostgreSQL, Redis, RabbitMQ, Keycloak, Seq, MassTransit, Entity Framework Core, CQRS, MediatR, DDD, Vertical Slice Architecture and Outbox Pattern implementation with using latest features of .NET 8 and C# 12.

--

--

Mehmet Ozkaya
Mehmet Ozkaya

Written by Mehmet Ozkaya

Software Architect | Udemy Instructor | AWS Community Builder | Cloud-Native and Serverless Event-driven Microservices https://github.com/mehmetozkaya

Responses (1)