Building Microservices and container solutions using Azure Service Fabric and Azure Container Service

Speaker: Ashutosh Chickeruir

The apps are shifting towards the cloud to give customers value, scenarios and experiences. You don’t have access to the hardware. You don’t have control if it keeps running, you have to prepare for the cases when it fails. As the need grows the scale becomes unpredictable. How to leverage all of this? Time for development and go to market is speeding up. How to give customers a non-disruptive service? How do you upgrade and deploy your service without your customers experiencing downtime.

Do you plan in evolving your service or app continually? Then Microservices is one of your choices.

There is a traditional application approach, monolith app divided by functional layers like data access, component libraries and UI. You have to redeploy the entire app if you want to fix a bug. This causes a lot of pain. Easier to design, but hard to maintain.

Or you break your monolithic app into microservices, a microservice app separates functionality into separate smaller services, you push the microservices into separate machines. No machine and service is tied together. The components become separate services. Upfront design costly, but long-term benefits are that it is easy to update, to scale and to manage.

The key part of an app is the state, that is stored in a database. Instead of a single monolithic database, with microservices you decouple the state from a central location and have it more segregated, state and microservices goes together.

The architecture benefits with microservices you can scale independently, have different technology stacks, you can update them with independent deployments, resolve conflicting dependencies by breaking them up to become independent.

Microservices Platform allows you to bring your microservices to this platform, takes away the pain of managing, just focus on your code and build your services.

Service Fabric gives you reliable actors and reliable services to design your services. It doesn’t restrict you in any way. You can bring in your guest executables. Lastly containers is making it seamless to deploy their apps in existing images, for hosting and deploying them.

Hello World in Service Fabric

  1. Create new project in Visual Studio: Service Fabric Service – Stateless Service
  2. Service Fabric operates in a listener mode, you create listeners
  3. Compile and deploy
  4. View cluster in Service Fabric Explorer

You have to have your Local Cluster run in Admin mode on your dev machine.

Complex app that will evolve over time that will provide many services then use the microservices architecture and Service Fabric.

Before migrating a traditional app decide the problems you are solving. You can have mixture of traditional and Microservices. Add new services for area needing agility and scale.

Containers vs. VMs: your app can run in one VM but on multiple containers so you don’t have to spin on multiple VMs.

How do you manage your state with cloud apps? Two patterns emerge:

  • Stateless services pattern by leveraging queues and adding cache to speed up the process
  • Stateful services pattern by decoupling your central data storage into your microservice, your middle-tier becomes your compute with optional cold data stores as a backup

It’s not just about building web apps, it can be used for IoT solutions to manage data.