1. Home
  2. Training Library
  3. Microsoft Azure
  4. Courses
  5. Creating an App on Azure Service Fabric

Collections

Contents

Introduction
1
Introduction
PREVIEW2m 59s
Section 3
10
Setup
3m 4s
Conclusion
13
Start course
Overview
DifficultyIntermediate
Duration52m
Students41

Description

Over the last few years, Docker and software container systems have become the industry standard for packaging and deploying applications. A consequence of this trend has been the development of container orchestration systems like Kubernetes and Apache Mesos. Microsoft Azure has entered the space with its own comprehensive system orchestration and management system, Azure Service Fabric.

What exactly is the value-add for Service Fabric? How do we use it to solve container-related technical challenges? This course answers both of those questions and goes even further by covering a number of relevant software design concepts. From this course, you will learn what Service Fabric does, how to use it to deploy a real application, and how Service Fabric incorporates design patterns and structures such as the actor model and collections.

By the end of the course, you should be ready to work with a team using Azure Service Fabric to create a working application.

Learning Objectives

  • Use Azure Service Fabric to solve infrastructure orchestration challenges
  • Learn about software concepts relevant to Service Fabric, including collections, the actor model, and stateful vs stateless services
  • Deploy an application to a Service Fabric cluster

Intended Audience

  • People looking to build applications using Microsoft Azure
  • People interested in container orchestration systems

Prerequisites

  • General knowledge of IT architecture
  • General knowledge of software containers



Transcript

In our final theoretical lesson, we're going to talk all about collections. With a solid grasp of both the concept of state and the actor model paradigm, this lesson can be a lot more efficient. We're just gonna briefly review some basic concepts regarding collections and then talk about Service Fabric's unique implementations. 

Now, collections are basically a kind of state. With collections, what we're talking about is stored data, but not really things like rows in a database or blobs in some other kind of long-term storage. A collection for our purposes refers to a local assemblage of calculations relevant to the problem at hand. They take the form of many different data structures, such as queues, stacks, lists, sets, arrays, trees. You know, if you've studied computer science, you've probably encountered these data structures. They all represent ways of storing data for processing, and they are all collections and can be used by programs to solve problems. 

It's outside of the scope of this course to go into a deep dive on every single data structure. Obviously data structure's a very rich subject worth studying on your own. We'll throw in some links if we can with this video. For our purposes, we're gonna focus on Service Fabric collections, specifically a feature known as Service Fabric Reliable Collections. 

What exactly is a Reliable Collection? What are we referring to? To kinda start to answer that question, let's consider some common alternative state stores, things you might use with Azure, things like Redis or even a, you know, an Azure tool like Azure Table or Azure Queue Service. These are collection services, essentially. All of these services attempt to store state in a performant and reliable way. However, all of them involve a lot of different tradeoffs regarding availability, speed, durability, that kinda thing. Consider Redis. Redis is a good example. Redis is single-threaded and it stores everything in memory, in RAM. So this makes it really fast, but it's also a potential bottleneck and a single point of failure. How do we go about creating collections for our services that are both fast and resilient? 

Service Fabric Reliable Collections, this is an attempt to answer that question. It's similar to the reliable actors that we talked about in the previous selection. Concretely speaking, Service Fabric Reliable Collections is a class, namely Microsoft.ServiceFabric.Data.Collections. By using the Reliable Collections API in your code, you automatically get highly available collections across your entire cluster. Reliable Collections are made highly available by being replicated across multiple nodes. Failure of a single instance will not cause you to lose any data. And furthermore, reliable collections are durable, as they are persistent to disk, so this makes them resilient to transient hardware failure, network failure, those kinds of things. And finally, another important thing is Reliable Collections are both transactional and asynchronous, and what this means is that you don't have to worry about IO blockages when maintaining multiple collections or managing multiple collections. 

Now, we're talking at a fairly abstract level referring to collections. You may be wondering specifically what type of collections are available from this API. As of the recording of this course, there are exactly three types. You get Reliable Dictionaries, Reliable Queues, and Reliable Concurrent Queues. For people who are not sure what those refer to, the first, Reliable Dictionaries, this is a key/value store, kinda like hash maps. The second one, Reliable Queues, this is a classic FIFO, F-I-F-O, first in, first out queue. And the third, the Reliable Concurrent Queues, is what you refer to as a best-effort ordering high concurrency queue. Best effort ordering means you don't have the same guarantee of order, but it's designed for concurrency. These are pretty common data structures, particularly the first two, and all three of them, because they're under the new Reliable Collection API, they're all asynchronous. They're all replicated. They're all durable. They're all transactional. 

Reliable Collections will be relevant to our app in section three for the demo. We won't be actually writing really the application code from scratch, but we'll be reviewing code, and understanding what Reliable Collections do will make things easier. If you would like to play around with the API yourself, check out the quick start guides in Azure's documentation. They'll help you start writing and set up your own local development environment where you can try things out. 

Now you should have a good understanding of both collections and the Service Fabric Reliable Collections feature. I definitely recommend digging into their API documentation if you wanna learn more. For our next section, we're going to actually start building and deploying our first app with Service Fabric. Feel free to review anything from this section if you need to. Looking forward to seeing you there.

About the Author

Students1643
Courses4

Jonathan Bethune is a senior technical consultant working with several companies including TopTal, BCG, and Instaclustr. He is an experienced devops specialist, data engineer, and software developer. Jonathan has spent years mastering the art of system automation with a variety of different cloud providers and tools. Before he became an engineer, Jonathan was a musician and teacher in New York City. Jonathan is based in Tokyo where he continues to work in technology and write for various publications in his free time.