Skip to content
Modular Monolith and ASP.NET Certification Exams

  • Home
  • Contact Us
  • Home
  • Contact Us
  • ASP.NET Certifications - Backend for Frontend pattern - Challenges and Pitfalls - Exams of ASP.NET - Managing the shopping cart

    Revisiting the CQRS pattern – Introduction to Microservices Architecture-1

    April 21, 2022 - By Dora Flick

    Command Query Responsibility Segregation (CQRS) applies the Command Query Separation (CQS) principle. Compared to what we saw in Chapter 14, Mediator and CQRS Design Patterns, we can push CQRS further using microservices or serverless computing. Instead of simply creating a clear separation between commands and queries, we can divide them even more using multiple microservices and data sources.CQS is a principle stating that a method should either return data or mutate data, but not both. On the other hand, CQRS suggests using one model to read the data and one model to mutate the data.Serverless computing is a cloud execution…

    Continue Reading
  • Backend for Frontend pattern - Challenges and Pitfalls - Exams of ASP.NET - Managing the shopping cart - Revisiting the CQRS pattern

    Conclusion – Introduction to Microservices Architecture

    March 2, 2022 - By Dora Flick

    In this section, we learned about using the Backend for Frontend (BFF) design pattern to front a micro e-commerce web application. We discussed layering APIs and the advantages and disadvantages of a two-layer design. We autogenerated strongly typed HTTP clients using Refit, managed a shopping cart, and fetched the catalog from the BFF. We learned how to use a BFF to reduce complexity by moving domain logic from the frontend to the backend by implementing multiple Gateway patterns.Here are a few benefits that we explored: Despite these benefits, using a BFF may also increase complexity and introduce potential performance overhead.…

    Continue Reading
  • Challenges and Pitfalls - Exams of ASP.NET - Managing the shopping cart - Revisiting the CQRS pattern - The message broker

    Managing the shopping cart – Introduction to Microservices Architecture

    February 20, 2022 - By Dora Flick

    One of the primary goals of our BFF is to reduce the frontend’s complexity. When examining the Baskets service, we realized it would add a bit of avoidable complexity if we were only to serve the raw operation, so instead, we decided to encapsulate all of the shopping cart logic behind a single endpoint. When a client POST to the api/cart endpoint, it: With this endpoint, the clients don’t have to worry about adding or updating. Here’s a simplified sequence diagram that represents this logic:  Figure 19.29: A sequence diagram that displays the high-level algorithm of the cart endpoint.  As…

    Continue Reading
  • Exams of ASP.NET - Managing the shopping cart - Revisiting the CQRS pattern - The message broker - What is a Modular Monolith?

    Fetching the shopping cart – Introduction to Microservices Architecture

    December 5, 2021 - By Dora Flick

    The Baskets service only stores the customerId, productId, and quantity properties. However, a shopping cart page displays the product name and price, but the Products service manages those two properties.To overcome this problem, the endpoint acts as an aggregation gateway. It queries the shopping cart and loads all the products from the Products service before returning an aggregated result, removing the burden of managing this complexity from the client/UI.Here’s the code main feature code: app.MapGet(    “api/cart”,    async (IWebClient client, ICurrentCustomerService currentCustomer, CancellationToken cancellationToken) =>    {        var basket = await client.Baskets.FetchCustomerBasketAsync(            new(currentCustomer.Id),            cancellationToken        );        var result = new ConcurrentBag<BasketProduct>();        await Parallel.ForEachAsync(basket,…

    Continue Reading
  • ASP.NET Certifications - Exams of ASP.NET - Managing the shopping cart - Revisiting the CQRS pattern - The message broker - What is a Modular Monolith?

    Features – Introduction to Microservices Architecture

    October 8, 2021 - By Dora Flick

    The BFF service serves an unexisting user interface, yet we can imagine what it needs to do; it must: Of course, the list of features could go on, like allowing the users to purchase the items, which is the ultimate goal of an e-commerce website. However, we are not going that far. Let’s start with the catalog. Fetching the catalog The catalog acts as a routing gateway and forwards the requests to the Products downstream service.The first endpoint serves the whole catalog by using our typed client (highlighted): app.MapGet(    “api/catalog”,    (IWebClient client, CancellationToken cancellationToken)        => client.Catalog.FetchProductsAsync(cancellationToken)); Sending the following requests…

    Continue Reading
  • ASP.NET Certifications - Backend for Frontend pattern - Exams of ASP.NET - Revisiting the CQRS pattern - The message broker - What is a Modular Monolith?

    Creating typed HTTP clients using Refit – Introduction to Microservices Architecture-2

    September 6, 2021 - By Dora Flick

    The preceding interface exposes the two clients we had Refit generate for us. Its implementation is fairly straightforward as well: public class DefaultWebClient : IWebClient{    public DefaultWebClient(IBasketsClient baskets, IProductsClient catalog)    {        Baskets = baskets ??throw new ArgumentNullException(nameof(baskets));        Catalog = catalog ??throw new ArgumentNullException(nameof(catalog));    }    public IBasketsClient Baskets { get; }    public IProductsClient Catalog { get; }} The preceding default implementation composes itself through constructor injection, exposing the two typed clients.Of course, dependency injection means we must register services with the container. Let’s start with some configuration. To make the setup code parametrizable and allow the Docker container to override those…

    Continue Reading
  • ASP.NET Certifications - Backend for Frontend pattern - Challenges and Pitfalls - Exams of ASP.NET - The message broker - What is a Modular Monolith?

    Creating typed HTTP clients using Refit – Introduction to Microservices Architecture-1

    August 16, 2021 - By Dora Flick

    The BFF service must communicate to the Baskets and Products services. The services are REST APIs, so we must leverage HTTP. We could leverage the out-of-the-box ASP.NET Core HttpClient class and IHttpClientFactory interface, then send raw HTTP requests to the downstream APIs. On the other hand, we could also create a typed client, which translates the HTTP calls to simple method calls with evocative names. We are exploring the second option, encapsulating the HTTP calls inside the typed clients.The concept is simple: we create one interface per service and translate its operation into methods. Each interface revolves around a service.…

    Continue Reading
  • ASP.NET Certifications - Backend for Frontend pattern - Challenges and Pitfalls - Exams of ASP.NET - What is a Modular Monolith?

    Composing the application – Introduction to Microservices Architecture

    June 3, 2021 - By Dora Flick

    Now that we set up HTTPS, we can build the container using the following commands: docker compose build We can execute the following command to start the containers: docker compose up This should start the containers and feed you an aggregated log with a color per service. The beginning of the log trail should look like this: [+] Running 3/0 ✔ Container c19-repr.products-1  Created    0.0s ✔ Container c19-repr.baskets-1   Created    0.0s ✔ Container c19-repr.bff-1       Created    0.0sAttaching to c19-repr.baskets-1, c19-repr.bff-1, c19-repr.products-1c19-repr.baskets-1   | info: Microsoft.Hosting.Lifetime[14]c19-repr.baskets-1   |       Now listening on: http://[::]:80c19-repr.baskets-1   | info: Microsoft.Hosting.Lifetime[14]c19-repr.baskets-1   |       Now listening on: https://[::]:443… To stop the services, press Ctrl+C. When you…

    Continue Reading
  • ASP.NET Certifications - Backend for Frontend pattern - Challenges and Pitfalls - Exams of ASP.NET

    Running the microservices – Introduction to Microservices Architecture

    April 24, 2021 - By Dora Flick

    Let’s start by exploring the deployment topology. First, we split the Chapter 18 REPR project into two services: Baskets and Products. Then, we add a BFF API that fronts the two services to simplify using the system. We do not have a UI per se, but one http file per project exists to simulate HTTP requests. Here’s a diagram that represents the relationship between the different services:  Figure 19.25: a diagram that represents the deployment topology and relationship between the different services  The easiest and most extendable way to start the projects is to use Docker, but it is optional;…

    Continue Reading
  • Backend for Frontend pattern - Challenges and Pitfalls - Exams of ASP.NET - Managing the shopping cart

    Project – REPR.BFF – Introduction to Microservices Architecture

    March 8, 2021 - By Dora Flick

    This project leverages the Backend for Frontend (BFF) design pattern to reduce the complexity of using the low-level API of the REPR project we created in Chapter 18. The BFF endpoints act as several types of gateway we explore.This design makes two layers of API, so let’s start here. Layering APIs From a high-level architecture perspective, we can leverage multiple layers of APIs to group different levels of operation granularity. For example, in this case, we have two layers: Here’s a diagram that represents this concept (high-level APIs are BFFs in this case, but the design could be nuanced):  Figure…

    Continue Reading
 Older Posts
Newer Posts 

Categories

  • ASP.NET Certifications
  • Backend for Frontend pattern
  • Challenges and Pitfalls
  • Exams of ASP.NET
  • Managing the shopping cart
  • Revisiting the CQRS pattern
  • The message broker
  • What is a Modular Monolith?

Archives

  • September 2024
  • July 2024
  • June 2024
  • April 2024
  • March 2024
  • January 2024
  • December 2023
  • November 2023
  • October 2023
  • August 2023
  • July 2023
  • April 2023
  • March 2023
  • January 2023
  • December 2022
  • November 2022
  • September 2022
  • August 2022
  • July 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • December 2021
  • October 2021
  • September 2021
  • August 2021
  • June 2021
  • April 2021
  • March 2021
  • February 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • June 2020
  • May 2020
  • April 2020

Recent Posts

  • Challenges and Pitfalls – Modular Monolith
  • Sending HTTP requests to the API – Modular Monolith
  • Inside the aggregator – Modular Monolith
  • Consuming the events from the basket module – Modular Monolith
  • Sending events from the catalog module – Modular Monolith
Developed by Heidi. All Rights Reserved 2022-2024