Book Image

Advanced Serverless Architectures with Microsoft Azure

By : Daniel Bass
Book Image

Advanced Serverless Architectures with Microsoft Azure

By: Daniel Bass

Overview of this book

Advanced Serverless Architectures with Microsoft Azure redefines your experience of designing serverless systems. It shows you how to tackle challenges of varying levels, not just the straightforward ones. You'll be learning how to deliver features quickly by building systems, which retain the scalability and benefits of serverless. You'll begin your journey by learning how to build a simple, completely serverless application. Then, you'll build a highly scalable solution using a queue, load messages onto the queue, and read them asynchronously. To boost your knowledge further, the book also features durable functions and ways to use them to solve errors in a complex system. You'll then learn about security by building a security solution from serverless components. Next, you’ll gain an understanding of observability and ways to leverage application insights to bring you performance benefits. As you approach the concluding chapters, you’ll explore chaos engineering and the benefits of resilience, by actively switching off a few of the functions within a complex system, submitting a request, and observing the resulting behavior. By the end of this book, you will have developed the skills you need to build and maintain increasingly complex systems that match evolving platform requirements.
Table of Contents (8 chapters)

Error Handling with Durable Functions


One of the most important benefits of orchestration is the relative simplicity of writing error-handling logic. In an orchestrated distributed system, when one of the steps of a transaction fails, the orchestrator knows about it and can handle it appropriately—by either failing the entire transaction, retrying, or falling back to systems (perhaps using a cache instead). In a choreographed system, on the other hand, the failing system will generally publish an exception message and then each microservice back up the chain has to pass on the error or deal with it. The error-handling logic becomes fragmented and difficult to understand.

Durable Functions allow you to express this error logic simply in code and in a fully serverless fashion. In our application, for instance, we could include a link in the email to the warehouse to state that the order was unsuccessful, and if that is clicked, we could send an email to the customer to regretfully inform them...