Book Image

Hands-On Microservices with C# 8 and .NET Core 3 - Third Edition

By : Gaurav Aroraa, Ed Price
Book Image

Hands-On Microservices with C# 8 and .NET Core 3 - Third Edition

By: Gaurav Aroraa, Ed Price

Overview of this book

<p>The microservice architectural style promotes the development of complex applications as a suite of small services based on specific business capabilities. With this book, you'll take a hands-on approach to build microservices and deploy them using ASP .NET Core and Microsoft Azure. </p><p>You'll start by understanding the concept of microservices and their fundamental characteristics. This microservices book will then introduce a real-world app built as a monolith, currently struggling under increased demand and complexity, and guide you in its transition to microservices using the latest features of C# 8 and .NET Core 3. You'll identify service boundaries, split the application into multiple microservices, and define service contracts. You'll also explore how to configure, deploy, and monitor microservices using Docker and Kubernetes, and implement autoscaling in a microservices architecture for enhanced productivity. Once you've got to grips with reactive microservices, you'll discover how keeping your code base simple enables you to focus on what's important rather than on messy asynchronous calls. Finally, you'll delve into various design patterns and best practices for creating enterprise-ready microservice applications. </p><p>By the end of this book, you'll be able to deconstruct a monolith successfully to create well-defined microservices.</p>
Table of Contents (16 chapters)

An overview of Azure Service Fabric

When we talk about microservices in the .NET Core world, Azure Service Fabric is a name that is widely used for microservices. In this section, we will discuss Fabric services.

This is a platform that helps us with easy packaging, deployment, and managing scalable and reliable microservices (the container is also like Docker). Sometimes it is difficult to focus on your main responsibility as a developer, because of complex infrastructural problems. With the help of Azure Service Fabric, developers need not worry about infrastructure issues. Azure Service Fabric provides various technologies and comes as a bundle that has the power of Azure SQL Database, Cosmos DB, Microsoft Power BI, Azure Event Hubs, Azure IoT Hub, and many more core services.

According to the official documentation (https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-overview), we can define Azure Service Fabric as follows:

  • Service fabric—any OS, any cloud: You just need to create a cluster of service fabric and this will run on Azure (cloud) or on-premises, on Linux, or on a Windows server. Moreover, you can also create clusters on other public clouds.
  • Service fabric: Stateless and stateful microservices. With the help of service fabric, you can build applications as stateless or stateful.

According to its official documentation (https://docs.microsoft.com/en-us/azure/service-fabric/), we can define stateless microservices as follows:

"Stateless microservices are not in the mutable state outside a request and its response from the service, for example Azure Cloud Services worker roles (Cloud Services should be avoided during development of new services). Stateful microservices are in a mutable state beyond the request and its response."

Full support for application lifecycle management: With the help of service fabric, get the support of a full application lifecycle that includes development, deployment, and so on.

You can develop a scalable application. For more information on this, refer to: https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-application-lifecycle.

You can develop highly reliable, stateless, and stateful microservices.

Cloud Services should be avoided during the development of new services.

There are different service fabric programming models available that are beyond the scope of this chapter. For more information, refer to: https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-choose-framework.

The aim of this section was to give an overview of Azure Service Fabric followed by stateless microservices. We have seen that Azure Service Fabric supports in developing scalable applications.