Lessons Learned from Microservices at Scale

Slides:



Advertisements
Similar presentations
Overview Of Microsoft New Technology ENTER. Processing....
Advertisements

Microsoft ® Application Virtualization 4.5 Infrastructure Planning and Design Series.
Computer System Architectures Computer System Software
Cloud computing is the use of computing resources (hardware and software) that are delivered as a service over the Internet. Cloud is the metaphor for.
Lecture 8 – Platform as a Service. Introduction We have discussed the SPI model of Cloud Computing – IaaS – PaaS – SaaS.
Introduction To Windows Azure Cloud
1 NETE4631 Managing the Cloud and Capacity Planning Lecture Notes #8.
Cloud Computing & Amazon Web Services – EC2 Arpita Patel Software Engineer.
Module 10: Monitoring ISA Server Overview Monitoring Overview Configuring Alerts Configuring Session Monitoring Configuring Logging Configuring.
Windows Azure Conference 2014 Deploy your Java workloads on Windows Azure.
Dev and Test Environments in the Cloud
AZR308. Building distributed systems on an abstraction against commodity hardware at Internet scale, composed of multiple services. Distributed System.
Microsoft Azure SoftUni Team Technical Trainers Software University
User Log Analyzing Algorithm Simulator 491 May15-11.
Resilience Planning and how the empire strikes back Bhakti
Cloud Computing is a Nebulous Subject Or how I learned to love VDF on Amazon.
6.894: Distributed Operating System Engineering Lecturers: Frans Kaashoek Robert Morris
Web Technologies Lecture 13 Introduction to cloud computing.
Microsoft Cloud Computing. Topics to be covered 1.Environmental Features of windows azure 2.What is Cloud Computing 3.Roles in Cloud Computing 4.Benefits.
Building Cloud Solutions Presenter Name Position or role Microsoft Azure.
(re)-Architecting cloud applications on the windows Azure platform CLAEYS Kurt Technology Solution Professional Microsoft EMEA.
Agility Dev TestDeploy Learn Agility.
© 2012 Eucalyptus Systems, Inc. Cloud Computing Introduction Eucalyptus Education Services 2.
ENGINEERING PRACTICES FOR CONTINUOUS DELIVERY: From Metrics and Deployment Pipelines to Integration and Microservices By Neal Ford with Tim Brown Deployment.
Canadian Bioinformatics Workshops
Introduction to Operating Systems Concepts
Mobile Application Solution
Computer System Structures
Unit 3 Virtualization.
Going Serverless with AWS Lambda
Deploying Web Application
Smart Building Solution
A Case Study: Automated Continuous Software Engineering Cycle (ACSEC)
OpenLegacy Training Day Four Introduction to Microservices
Tulika Chaudharie / Harikharan Krishnaraju
Operating System.
Google App Engine Mandeep Singh (37926)
Open Source distributed document DB for an enterprise
2016 Citrix presentation.
Chapter 1: Introduction
Cloud Data platform (Cloud Application Development & Deployment)
Smart Building Solution
Platform as a Service.
Logo here Module 3 Microsoft Azure Web App. Logo here Module Overview Introduction to App Service Overview of Web Apps Hosting Web Applications in Azure.
Cloud Computing Platform as a Service
Mobile Application Solution
Chapter 18 MobileApp Design
Introduction to Microservices Prepared for
Amplifying feedback through Microservices and Containers
Week 01 Comp 7780 – Class Overview.
Service Fabric Patterns & Best Practices
Microsoft Build /8/2018 5:15 AM © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY,
Amplifying feedback through Microservices and Containers
20409A 7: Installing and Configuring System Center 2012 R2 Virtual Machine Manager Module 7 Installing and Configuring System Center 2012 R2 Virtual.
QNX Technology Overview
Process & its States Lecture 5.
Design pattern for cloud Application
1/3/2019 9:40 AM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS.
Saranya Sriram Developer Evangelist | Microsoft
Technical Capabilities
Increase and Improve your PC management with Windows Intune
Developing Microsoft Azure Solutions Jump Start
Outline Operating System Organization Operating System Examples
Agenda Need of Cloud Computing What is Cloud Computing
Johan Lindberg, inRiver
Running C# in the browser
Containers and DevOps.
9/16/2019 6:55 PM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN.
Presentation transcript:

Lessons Learned from Microservices at Scale Mike Calvo Target Corp

about this talk Speaker: Basis: Director Engineering Target – target.com MSSE Adjunct faculty 25 Years programming and leadership experience Basis: Lessons learned from building services to support target.com and Target Mobile apps Experience from building non-commerce (non-PCI) micro-services in the cloud

Defining microservices Small, single function endpoints Loosely coupled services that collaborate to provide a product or experience Each service performs a specific thing Single domain Follows OO Single Responsibility Principle Often depends on supporting infrastructure Load balancers, proxies, databases, caching stores, CDN, configuration

Credit: https://cloud.google.com/solutions/scalable-and-resilient-apps Scalability Credit: https://cloud.google.com/solutions/scalable-and-resilient-apps

Real Life Adventure Story Mongo and the Monolith

Lessons from Treachery on Mongo Independent service deployments can save you from total failure External Dependencies: Monitor all access times Circuit break every remote call

Independent Deployments Failures are more isolated Independent scaling Capacity matches demand Auto-scaling independently CPU-based Network-based Memory-based Credit "Building Microservices" by Sam Newman

Monitor Access Times Database Caching layers Dependent services Options Log - ELK Emit metrics – Prometheus or Dropwizard Visualize Grafana Kibana Splunk

Circuit Breaker Pattern for preventing cascading errors from remote resources Wrap a call to a remote resource Define thresholds when circuit should be “open” Timeout Error percentages When circuit is open no calls are made to remote resource Configure circuit to be retried after a period of time Alerts can fire when circuits are open

Netflix Hystrix and Turbine Open source implementation of circuit-breaker pattern Java library for latency and fault-tolerant logic Wrap remote calls with Hystrix Fallback responses Configure timeouts and error thresholds Turbine: Web-base dashboard for displaying connection health and circuit status

Turbine Example Credit Netflix

Other Lessons Stateless services Asynchronous I/O Caching patterns Deploy frequently Protect uptime

Stateless Services Each request allocates and frees memory required to process the request Avoid problem of session affinity Allows any instance to respond to any request Java: avoid using HTTP Session object Solutions for session-based problems Time-expired key value stores (Memcached or Redis) Fast read access data stores (MongoDB)

Asynchronous I/O Traditional forms of system I/O calls are blocking Current thread waits for all data to be read or written before continuing More complex forms of I/O enable notification when operation has completed Enables non-blocking I/O More complex programming model Frees CPU to do more work while waiting for I/O to complete Asynchronous I/O enables higher throughput for I/O-bound processes Network calls Database access File access

Credit: https://www. toptal

Single Event Loop Model Main application thread processes events in a queue Inbound HTTP requests generate events If the handling of a request requires I/O use asynchronous I/O When I/O completes an event is placed on the queue with the result Offer better performance for I/O-bound services

Credit: https://medium

Asychronous I/O Server Platforms Node Javascript I/O performed on background threads Netty/Vertx/Ratpack JVM-based implementation Go Go language developed by Google Natively compiled Go-routines can be suspended based on activity Callback structure abstracted away from developer

Caching Time-to-live (TTL) Micro caching Grace period Soft Hard Micro caching Grace period Clearing considerations Composite keys Edge caching CDN – Akamai, Fastly Proxies – Varnish

Deploy Frequently Team of four engineers should deploy several times per week Deploy small things frequently Requires automated testing User acceptance testing still required Continuous Integration/Continuous Deployment Deployments are Automated and fast

Favoring Speed Though microservices support building with diverse platforms this hasn’t been strong feature for our teams Building on a well-understood tech stack (JVM) leverages efficiencies of deployment, scale and troubleshooting Ruthlessly pursue reducing time from code change to deploy

Common Cloud Deployment Models Virtual Machines Containers Mesos Docker/Kubernettes Serverless

Virtual Machines Each application server runs on its own dedicated VM Full OS instance Select UNIX or Windows flavors Supported natively via cloud provider Provision using cloud console or API Spinnaker Abstraction layer enabling cross-cloud provisioning and deployment Netflix

Containers App runs within a container which is managed by an environment Environment optimizes usage of infrastructure Free memory and processors will be allocated during scaling Disk access managed by environment Examples: Docker and Mesos

Serverless Cloud provider enables deployments of code into platform Ephemeral containers Function as a service API developer not concerned with provisioning of compute resources Typically limited platform options Common options: JavaScript, Python and Java Examples AWS Lambda Google Cloud Functions Microsoft Azure Functions

Protect Uptime Need to be available around the clock Measured in 9s (99.999% up) Monitoring and Alerting Key System metrics Health checks/Aliveness checks Response codes Response times Non functional requirements of all services must include monitoring

Microservices Advantages Supports technology diversity Can be developed with any language on any platform Experimentation Correct tool for the job Resilience Scaling Faster to develop and release Organizational alignment Composability Optimize for replace ability

Microservices Disadvantages/Challenges Complicated deployment and management Sharing of code is harder Technology/Architecture consistency is harder to obtain Decisions on how to partition system

More Details ”Building Microservices” by Sam Newman Martin Fowler Microservices https://martinfowler.com/articles/microservices.html 12 Factor Apps https://12factor.net/