Practical Microservices with Dapr and .NET: A developer's guide to building cloud-native applications using the event-driven runtime, 2nd Edition
Book information
Description
Use the innovative, highly portable event-driven distributed application runtime to simplify building resilient and scalable microservices for cloud and edge applications. Purchase of the print or Kindle book includes a free eBook in the PDF format. Key FeaturesBuild resilient, stateless, and stateful microservice applications that run on the cloud and edgeOvercome common issues in distributed systems, such as low latency and scaling, using any language and frameworkLearn how to expose and operate Dapr applications with multiple optionsBook Description This second edition will help you get to grips with microservice architectures and how to manage application complexities with Dapr in no time. You'll understand how Dapr simplifies development while allowing you to work with multiple languages and platforms. Following a C# sample, you'll understand how Dapr's runtime, building blocks, and software development kits (SDKs) help you to simplify the creation of resilient and portable microservices. Dapr provides an event-driven runtime that supports the essential features you need for building microservices, including service invocation, state management, and publish/subscribe messaging. You'll explore all of those in addition to various other advanced features with this practical guide to learning Dapr. With a focus on deploying the Dapr sample application to an Azure Kubernetes Service cluster and to the Azure Container Apps serverless platform, you'll see how to expose the Dapr application with NGINX, YARP, and Azure API Management. By the end of this book, you'll be able to write microservices easily by implementing industry best practices to solve problems related to distributed systems. What you will learnUse Dapr to create services, invoking them directly and via pub/subDiscover best practices for working with microservice architecturesLeverage the actor model to orchestrate data and behaviorExpose API built with Dapr applications via NGINX and Azure API ManagementUse Azure Kubernetes Service to deploy a sample applicationMonitor Dapr applications using Zipkin, Prometheus, and GrafanaScale and load test Dapr applications on KubernetesGet to grips with Azure Container Apps as you combine Dapr with a serverless platformWho this book is for This book is for developers looking to explore and implement microservices architectures in Dapr applications using .NET examples. Whether you are new to microservices or have knowledge of this architectural approach and want to get hands-on experience using Dapr, you'll find this book useful. Familiarity with .NET will help you to understand the C# samples and code snippets used in the book. Table of ContentsIntroducing DaprDebugging Dapr SolutionsMicroservices Architecture with DaprService-to-Service invocationIntroducing State ManagementPublish and SubscribeResource bindingsUsing ActorsDeployment to KubernetesExposing Dapr ApplicationsTracing Dapr ApplicationLoad testing and Scaling DaprLeveraging serverless containers with Dapr Cover Title Page Copyright and Credits Foreword Contributors Table of Contents Preface Part 1: Introduction to Dapr Chapter 1: Introducing Dapr Technical requirements Understanding Dapr What Dapr is not Exploring Dapr Setting up Dapr Docker Intalling the Dapr CLI Installing .NET Installing VS Code Installing Windows Terminal Installing Dapr in self-hosted mode Installing Dapr on Kubernetes Updating Dapr version Building our first Dapr sample Summary Questions Further reading Chapter 2: Debugging Dapr Solutions Technical requirements Configuring VS Code debug for Dapr Attaching the debugger Examining the debug configuration Debugging a Dapr multi-project solution Creating .NET solutions Launching the configuration Tasks Launching debug sessions individually Launching compound debug sessions Using Tye with Dapr Installing Tye Using Tye Summary Questions Further reading Chapter 3: Microservices Architecture with Dapr Introducing our sample solution Discovering microservices Service Autonomy Automated deployment Bounded context Loose coupling Event-driven architecture Observability Sustainability Adopting microservices patterns Building an e-commerce architecture Bounded contexts An example – sales microservices Building microservices with Dapr Loosely coupled microservices Autonomous microservices Observable microservices Scalable microservices Event-driven microservices Stateless microservices Summary Questions Further reading Part 2: Building Microservices with Dapr Chapter 4: Service-to-Service Invocation Technical requirements Invoking services with Dapr Introducing service-to-service invocation Name resolution Resiliency Service invocation with the .NET SDK Creating a project for the Order service Configuring Dapr in ASP.NET Implementing Dapr with an ASP.NET controller Creating a project for the Reservation service Preparing the debugging configuration Implementing Dapr with an ASP.NET Minimal API Recap Comparing HTTP and gRPC for Dapr gRPC in ASP.NET Creating a gRPC microservice Winning latency with gRPC Summary Questions Further reading Chapter 5: Introducing State Management Technical requirements Managing state in Dapr State, stateless, and stateful State stores in Dapr Transactions Concurrency Consistency Interaction with state stores Resiliency Stateful services in an e-commerce ordering system Stateful reservation-service Handling the Dapr state in ASP.NET Using Azure Cosmos DB as a state store Setting up Azure Cosmos DB Configuring the state store Testing the state store Partitioning with Cosmos DB Wrapping up Summary Chapter 6: Publish and Subscribe Technical requirements Using the pub/sub pattern in Dapr Using Azure Service Bus (ASB) in Dapr Subscribing to a topic Configuring a pub/sub component Publishing to a topic Inspecting the messages Implementing a saga pattern Publishing messages to Dapr Subscribing to a Dapr topic Testing the saga pattern Summary Chapter 7: Resource Bindings Technical requirements Learning how to use Dapr bindings Configuring a cron input binding Testing the cron binding Using Twilio output bindings in Dapr Signing up for a Twilio trial Configuring a Twilio output binding Signaling via the output binding Verifying the notification Ingesting data with the Azure Event Hubs input binding Creating an Azure Event Hubs binding Configuring the input binding Implementing an Azure Event Hubs input binding Producing events Summary Chapter 8: Using Actors Technical requirements Using actors in Dapr Introduction to the virtual actor pattern Configuring a new state store Verifying the configuration Actor concurrency, consistency, and lifetime Placement service Concurrency and consistency Resiliency Lifetime Implementing actors in an e-commerce reservation system Preparing the Actor’s projects Implementing the actor’s model Accessing actors from other Dapr applications Inspecting the actor’s state Summary Part 3: Deploying and Scaling Dapr Solutions Chapter 9: Deploying to Kubernetes Technical requirements Setting up Kubernetes Creating an Azure resource group Creating an AKS cluster Connecting to the AKS cluster Setting up Dapr on Kubernetes Deploying a Dapr application to Kubernetes Building Docker images Pushing Docker images Managing secrets in Kubernetes Deploying applications Exposing Dapr applications to external clients Summary Chapter 10: Exposing Dapr Applications Technical requirements Daprizing ingress controllers Setting up API management on Kubernetes Configuring Dapr policies with API management Summary Chapter 11: Tracing Dapr Applications Technical requirements Observing applications in Dapr Tracing with Zipkin Setting up Zipkin Configuring tracing with Zipkin Enabling tracing in Dapr Investigating with Zipkin Analyzing metrics with Prometheus and Grafana Installing Prometheus Installing Grafana Importing dashboards Summary Chapter 12: Load Testing and Scaling Dapr Technical requirements Bash Python Locust Kubernetes configuration Scaling Dapr on Kubernetes Replicas Autoscale Resource requests and limits Load testing with Locust Load testing Dapr Preparing the data via port-forwarding Testing Locust locally Locust on Azure Container Instances Observing the Horizontal Pod Autoscaler Autoscaling with KEDA Summary Chapter 13: Leveraging Serverless Containers with Dapr Technical requirements Learning about the Azure Container Apps architecture Understanding the importance of Azure Container Apps Setting up Azure Container Apps Deploying Dapr with Azure Container Apps Configuring Dapr components in Azure Container Apps Exposing Azure container apps to external clients Observing Azure container apps Autoscaling Azure Container Apps with KEDA Learning about KEDA autoscalers Applying KEDA to Azure container apps Testing KEDA with container apps Summary Assessments Index Other Books You May Enjoy
Similar books
Practical Microservices with Dapr and .NET: A developer's guide to effortlessly building cloud-native applications with a language-agnostic runtime
2021 · EPUB
MySQL® Notes for Professionals book
2018 · PDF
MrExcel 2022: Boosting Excel
2022 · PDF
MrExcel 2022: Boosting Excel
2022 · PDF
Session C11: Ancient Cultural Landscapes in South Europe – their Ecological Setting and Evolution, Session C22: Gardeners from South America, Session S04: Agro-Pastoralism and Early Metallurgy Sessions, Session WS29: The Idea of Enclosure in Recent Iberian Prehistory, Session C88: Rhytmes et causalites des dynamiques de l'anthropisation en Europe entre 6500 ET 500 BC: Hypotheses socio-culturelles et/ou climatiques: Proceedings of the XV UISPP World Congress (Lisbon 4-9 September 2006) / Actes du XV Congrès Mondial (Lisbonne 4-9 Septembre 2006) Vol.36
2010 · PDF
THE BRITISH ARMY IN INDIA: ITS PRESERVATION BY AN APPROPRIATE CLOTHING, HOUSING, LOCATING, RECREATIVE EMPLOYMENT, AND HOPEFUL ENCOURAGEMENT OF THE TROOPS. with AN APPENDIX ON INDIA : THE CLIMATE OP ITS HILLS ; THE DEVELOPMENT OF ITS RESODRCBS, INDUSTRY, AND ARTS ; THE ADMINISTRATION OF JUSTICE ; THE BLACK ACT ; THE PROGRESS OF CHRISTIANITY ; THE TRAFFIC IN OPIUM ; THE VALUE OF INDIA ; PERMANENT CAUSES OF DISAFFECTION, AND OF THE RECENT REBELLION ; THE TRADITIONARY POLICY; MISGOVERNMENT BY NATIVE RULERS ; ANNEXATIONS OF THEIR TERRITORY, ETC.
1858 · PDF
Idries Shah 27 Books Collection : A Perfumed Scorpion, A Veiled Gazelle, Caravan of Dreams, Darkest England, Destination Mecca, Evenings with Idries Shah, Knowing How to Know, Learning How to Learn, Letters and Lectures of Idries Shah, Neglected aspects of Sufi study, Observations, Oriental Magic, Reflections, Seeker after Truth, Special Illumination, Special Problems in the study of Sufi ideas, Sufi thought and action, Tales of the Dervishes, The Dermis Probe, The Elephant in the Dark, The Englishman Handbook, Idries Shah Antology, The Magic Monastery, The natives are restless, wisdom of the Idiots PDF.
2022 · PDF
The travels of Capts. Lewis and Clarke from St. Louis, by way of the Missouri and Columbia rivers, to the Pacific ocean; performed in the years 1804, 1805 & 1806, by order of the government of the United States. Containing delineations of the manners, customs, religion, &c. of the Indians, comp. from various authentic sources, and original documents, and a summary of the Statistical view of the Indian nations, from the official communication of Meriwether Lewis. Illustrated with a map of the country, inhabited by the western tribes of Indians
1809 · PDF