Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Advanced Serverless Architectures with Microsoft Azure
Advanced Serverless Architectures with Microsoft Azure

Advanced Serverless Architectures with Microsoft Azure: Design complex serverless systems quickly with the scalability and benefits of Azure

Arrow left icon
Profile Icon Daniel Bass
Arrow right icon
€18.99 per month
Paperback Feb 2019 278 pages 1st Edition
eBook
€8.99 €23.99
Paperback
€29.99
Subscription
Free Trial
Renews at €18.99p/m
Arrow left icon
Profile Icon Daniel Bass
Arrow right icon
€18.99 per month
Paperback Feb 2019 278 pages 1st Edition
eBook
€8.99 €23.99
Paperback
€29.99
Subscription
Free Trial
Renews at €18.99p/m
eBook
€8.99 €23.99
Paperback
€29.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
Table of content icon View table of contents Preview book icon Preview Book

Advanced Serverless Architectures with Microsoft Azure

Chapter 2. Microservices and Serverless Scaling Patterns

Note

Learning Objectives

By the end of this chapter, you will be able to:

  • Describe the unique scaling challenges presented by serverless architectures

  • Create a serverless queue for feeding your product's database

  • Design a caching strategy to fit any requirements with a serverless architecture

  • Use asynchronous processing rather than synchronous processing

Note

This chapter explains how to build a highly scalable solution using a queue, load messages onto the queue, and read them asynchronously.

Introduction


In the previous chapter, you created all of the core individual components of a complete serverless architecture. The important thing to note is the total separation of frontend and backend development—this will free both disciplines of development to progress rapidly.

In this chapter, you will learn how to connect them up to deliver the first feature of your serverless application. Here, we will be covering asynchronous processing and caching as a way to increase the scalability of serverless architecture.

Microservices


Individual serverless components have the capability to scale infinitely (up to the capacity of your cloud provider, which is infinite when infinity is considered relative to an average company's compute power). This sounds, and indeed is, amazing and very useful, but these components tend to expose issues with application architectures that you previously couldn't see. This issue is called serverless backpressure. The following backend components can be impacted by this backpressure:

  • Third-party APIs: It is incredibly common to depend on third-party APIs such as Stripe, Twitter, and Paypal these days. Whether these are to provide payment services (like Stripe or the Bitcoin network) or to provide data (like Bloomberg or Reuters), most applications have an integration of some kind. Serverless applications can cause unexpected problems with these relationships by flooding them with requests far beyond what they can handle. These services often have a rate limit in their SLA too...

Serverless Queues


One of the most useful components in scaling a serverless architecture is the queue. Queues are a key asynchronous processing concept. In a queue, data points are added to the back of the queue and taken from the front. An example of this is a first-in-first-out data structure. In a cloud architecture, a queue will generally store events or messages from an upstream process until subscribers downstream have the time to process them.

An important thing to understand before deciding to use a queue is the compromise you are making in using one. In a synchronous operation (that is, inserting a record into a database all in one operation), if something goes wrong, you have instant feedback to your user. In an asynchronous operation (that is, dropping an event onto a queue that a worker later picks up to insert into the same database), if the later operations go wrong, then the user has usually left the application and cannot fix their mistake or call support.

A good way to try...

Caching


The practice of storing previously requested data in a small, high-speed data layer and returning it, instead of requesting the data again, is called caching. Caching is a vast and complex topic, so this book will focus on the cheapest wins for your application rather than attempting to cover everything.

Caching both reduces replicated demand for compute and speeds up applications. It is also very useful for reducing serverless backpressure in two ways: first, by reducing the number of requests that hit the backend and second, by reducing the number of requests that hit "weak" resources.

Client-side caching is the easiest way to have an immediate impact on the number of requests you see per second, and also the easiest to understand in terms of requirements. It also immediately improves the performance of your application for your end users, as they receive data much faster. However, client-side caching is frequently done badly or not at all. Serverless has a great way of highlighting...

Asynchronous by Default


A lot of applications are synchronous. That is to say, when you perform an action, the program processes it and returns the answer, holding up the program and the user from doing anything else until it has returned the answer. This is the way most developers design their applications, particularly those used to REST. However, this can become a serious barrier to scalability. If your application needs to process complex requests, the time taken becomes intolerable to the end user. This is the point where most developers will decide to adjust the behavior for this request so that the synchronous part simply includes validation, and processing is done asynchronously. Asynchronous behavior is where the user performs an action and the application processes it when it has time, rather than keeping the user sitting there.

With a serverless architecture, it is a very good idea to shift your mindset. When designing applications, you should endeavor to be asynchronous by default...

Summary


In this chapter, you have learned about the principles of scalability in a serverless architecture, which will help guide you throughout your serverless application development. By making your applications asynchronous and utilize caching, your serverless application will scale effectively. You've also added headers to explicitly control caching behavior and utilized queues and other asynchronous methods. In the next chapter, you will be learning about Durable Functions, and how you can use them to orchestrate long-running workflows.

Left arrow icon Right arrow icon

Key benefits

  • 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

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.

Who is this book 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.

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

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Feb 28, 2019
Length: 278 pages
Edition : 1st
Language : English
ISBN-13 : 9781788479127
Vendor :
Microsoft
Languages :
Concepts :
Tools :

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

Publication date : Feb 28, 2019
Length: 278 pages
Edition : 1st
Language : English
ISBN-13 : 9781788479127
Vendor :
Microsoft
Languages :
Concepts :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 103.97
Azure Serverless Computing Cookbook
€36.99
Advanced Serverless Architectures with Microsoft Azure
€29.99
Serverless Integration Design Patterns with Azure
€36.99
Total 103.97 Stars icon
Banner background image

Table of Contents

6 Chapters
Complete Serverless Architectures Chevron down icon Chevron up icon
Microservices and Serverless Scaling Patterns Chevron down icon Chevron up icon
Azure Durable Functions Chevron down icon Chevron up icon
Security Chevron down icon Chevron up icon
Observability Chevron down icon Chevron up icon
Chaos Engineering Chevron down icon Chevron up icon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.