Advanced Serverless Architectures with Microsoft Azure
eBook - ePub

Advanced Serverless Architectures with Microsoft Azure

Design complex serverless systems quickly with the scalability and benefits of Azure

Daniel Bass

Share book
  1. 278 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Advanced Serverless Architectures with Microsoft Azure

Design complex serverless systems quickly with the scalability and benefits of Azure

Daniel Bass

Book details
Book preview
Table of contents
Citations

About This Book

Build complex, observable, and fault-tolerant serverless systems easily on Microsoft Azure.

Key Features

  • Use serverless systems to help you fulfill complex requirements
  • Develop your knowledge of Azure Microsoft Serverless
  • Understand concepts with a hands-on approach and helpful examples

Book Description

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.

What you will learn

  • Understand what true serverless architecture is
  • Study how to extend and scale architectures until they become 'complex'
  • Implement durable functions in your design
  • Improve the observability of your serverless architecture
  • Implement security solutions using serverless services
  • Learn how to 'practise' chaos engineering in production

Who this book is for

Advanced Serverless Architectures with Microsoft Azure is is ideal if you want to build serverless systems with fewer outages and high performance using Azure. Familiarity with the C# syntax and Azure Functions and ARM templates will help you to benefit more from this book. Prior knowledge of basic front-end development, HTML JS, and CSS is beneficial but not essential. Some DevOps knowledge is also beneficial but not essential.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Advanced Serverless Architectures with Microsoft Azure an online PDF/ePUB?
Yes, you can access Advanced Serverless Architectures with Microsoft Azure by Daniel Bass in PDF and/or ePUB format, as well as other popular books in Computer Science & Cloud Computing. We have over one million books available in our catalogue for you to explore.

Information

Year
2019
ISBN
9781788395571
Edition
1

Chapter 1

Complete Serverless Architectures

Learning Objectives

By the end of this chapter, you will be able to:
  • Create a Function-as-a-Service
  • Use a Database-as-a-Service
  • Create a serverless web application
This chapter will cover the main components that are required to make a complete serverless architecture, beyond the FaaS components (Azure Functions).

Introduction

Serverless architecture, while still a small field, has continued to grow as a topic of interest in software development. Some serverless architectures are now becoming highly complex, powering massively scalable applications that deliver business value across domains. As serverless architecture advances in complexity, it presents unique challenges that aren't really present in other approaches, or if they are present, they are hidden by the other, more major issues that plague those approaches. This book will give you a pragmatic, rational, and experience-based approach to architecting your serverless solution to minimize issues and maximize scalability.
Let's first define Serverless. The current working definition of serverless that's defined in this book is as follows: "A service that abstracts away all server details, provides reactive scaling to demand, and is charged on a resource-usage-based payment model". This encompasses serverless databases and takes into account reactive scaling. Serverless fits use cases from simple web applications to massively scaled and complex applications with millions of users. This book will help you build from a simple web application (with the capability to scale to millions of users with no extra effort from the developers) to a complex application, thus utilizing security, observability, queuing, and caching.
Incorporating serverless components in other styles of architecture is relatively straightforward—for instance, it is easy to use a Function-as-a-Service as a simple replacement for a RESTful API. This approach generally works well, and you can gain large advantages by doing this. To fully realize the benefits of serverless, however, a complete serverless architecture is needed. Building one of these once will also change the way you think about application architecture, meaning that even if you have requirements that demand a non-serverless component, you can still keep the rest of the architecture serverless-first. The components that are covered in this chapter are Function-as-a-Service (FaaS), the Serverless Database, and the Serverless Website. Other components that will be covered later are queues, event hubs, authentication services, and monitoring and logging services.

Function-as-a-Service with a Simple HTTP Trigger

The core component of any serverless architecture is the Function-as-a-Service. The idea of any Function-as-a-Service is basically this: you write your code, send it to your cloud provider, and they handle every aspect of making that available to yourself and your customers. This means developers focus purely on the business logic, and not on unrelated technical things. This also means developers can deliver value much faster, and in a modern business, this is the single-most important advantage you can have.
If you've completed the previous book, Beginning Serverless Architectures with Microsoft Azure, you will know about Azure's product in this area very well: Azure Functions. Azure Functions can be written in C# (.NET Core 2), F# (.NET Core 2) or Javascript (Node 8 and 10). There's a plethora of other languages with varying levels of support, such as Python, Java, and PowerShell, but as they are in preview or marked as experimental, they won't be covered here, and they aren't advised for production use. The experimental languages, and Python and Java in their preview states, have very poor performance as well. Azure Functions also comes in two versions, 1.x and 2.x. We will solely be using version 2.x in this book.

Note

1.x's underlying infrastructure is written in .NET and 2.x's is written in the newer, faster, and cross-platform .NET Core. Version 2 is now in General Availability, and therefore it is advised to only use it for new projects (unless you have some strong dependency on a .NET-only library). It would also be advisable to convert any existing functions to version 2 for the performance benefits alone, but it's also likely that version 1 will eventually be deprecated. If you are looking for support for other languages, Java is the most likely next language to be fully supported by Azure Functions and there are a large number of unsupported yet reasonably functional languages. Alternatively, AWS Lambda supports Java, Go, and Python, in addition to C# and Node.js.

Exercise 1: Creating an Azure Function

In this exercise, you will be learning how to create a function, which is the most important component of any serverless architecture, in C#. We will be using Azure Functions to do this. We will also see how to run this function locally and in the cloud:
  1. Let's begin by first creating our Azure function. Create a new folder in your development area called ProductsApi. Open a command-line tool inside the folder and open Visual Studio Code by typing code . or clicki...

Table of contents