Container Days: Architecting Modern Apps on AWS

Download Container Days: Architecting Modern Apps on AWS

Post on 11-Jan-2017

85 views

Category:

Technology

0 download

Embed Size (px)

TRANSCRIPT

<ul><li><p> 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.</p><p>Architecting Modern Applications on AWS: VMs, Containers, Microservices, Lambda </p><p>and More</p><p>2016-11-04</p><p>Mackenzie Kosut@mkosut AWS Startup Evangelist </p><p>Tara E. Walker@taraw</p><p>AWS Technical Evangelist</p></li><li><p>15 min Evolution from Monoliths to Microservices</p><p>15 minCore Principles of Microservices Approaches to building Microservices on AWS</p><p>15 min Other Architectural Principles</p><p>5 min Additional Resources</p><p>Architecting Modern Applications on AWS: VMs, Containers, Microservices, Lambda and More</p></li><li><p>2006 EC2 &amp; S3</p><p>2016 70+ Managed Services</p><p>Kinesis Streaming Analytics, Mobile Testing, Redshift Datawarehouse, Code Deploy/Build Tools, Elastic Container Service, Application Load Balancer, Lambda, API Gateway, DynamoDB, Elastic Map Reduce (Hadoop/Spark/Presto/etc), Elastic Beanstalk, Elastic Transcoder, RDS, Elasticsearch, more..</p></li><li><p>ENTERPRISE APPS</p><p>DEVELOPMENT &amp; OPERATIONSMOBILE SERVICESAPP SERVICESANALYTICS</p><p>DataWarehousing</p><p>Hadoop/Spark</p><p>Streaming Data Collection</p><p>Machine Learning</p><p>Elastic Search</p><p>Virtual Desktops</p><p>Sharing &amp; Collaboration</p><p>Corporate Email</p><p>Backup</p><p>Queuing &amp; Notifications</p><p>Workflow</p><p>Search</p><p>Email</p><p>Transcoding</p><p>One-click App Deployment</p><p>Identity</p><p>Sync</p><p>Single Integrated Console</p><p>PushNotifications</p><p>DevOps Resource Management</p><p>Application Lifecycle Management</p><p>Containers</p><p>Triggers</p><p>Resource Templates</p><p>TECHNICAL &amp; BUSINESS SUPPORT</p><p>Account Management</p><p>Support</p><p>Professional Services</p><p>Training &amp; Certification</p><p>Security &amp; Pricing Reports</p><p>Partner Ecosystem</p><p>Solutions Architects</p><p>MARKETPLACE</p><p>Business Apps</p><p>Business Intelligence</p><p>DatabasesDevOps Tools</p><p>NetworkingSecurity Storage</p><p>RegionsAvailability Zones</p><p>Points of Presence</p><p>INFRASTRUCTURE</p><p>CORE SERVICES</p><p>ComputeVMs, Auto-scaling, &amp; Load Balancing</p><p>StorageObject, Blocks, Archival, Import/Export</p><p>DatabasesRelational, NoSQL, Caching, Migration</p><p>NetworkingVPC, DX, DNS</p><p>CDN</p><p>Access Control</p><p>Identity Management</p><p>Key Management &amp; Storage</p><p>Monitoring &amp; Logs</p><p>Assessment and reporting </p><p>Resource &amp; Usage Auditing</p><p>SECURITY &amp; COMPLIANCE</p><p>Configuration Compliance</p><p>Web application firewall</p><p>HYBRIDARCHITECTURE</p><p>Data Backups</p><p>Integrated App Deployments</p><p>DirectConnect</p><p>IdentityFederation</p><p>IntegratedResource Management</p><p>Integrated Networking</p><p>API Gateway</p><p>IoT</p><p>Rules Engine</p><p>Device Shadows</p><p>Device SDKs</p><p>Registry</p><p>Device Gateway</p><p>Streaming Data Analysis</p><p>Business Intelligence</p><p>MobileAnalytics</p></li><li><p>2009</p><p>48</p><p>280</p><p>722</p><p>82</p><p>2011 2013 2015</p><p>706</p><p>September2016</p></li><li><p>Migrating from Monolith to Microservice</p></li><li><p>The Monolith</p></li><li><p>Challenges with monolithic software</p><p>Long Build/Test/Release Cycles(who broke the build?)</p><p>Operationsis a nightmare(module X is failing, whos the owner?)</p><p>Difficult to scale</p><p>New releasestake months</p><p>Long time to addnew features</p><p>Architecture is hard to maintain and evolve</p><p>Lack of innovation</p><p>Frustrated customers</p><p>Lack of agility</p></li><li><p>Challenges with monolithic software</p><p>Long Build/Test/Release Cycles(who broke the build?)</p><p>Operationsis a nightmare(module X is failing, whos the owner?)</p><p>Difficult to scale</p><p>New releasestake months</p><p>Long time to addnew features</p><p>Architecture is hard to maintain and evolve</p><p>Lack of innovation</p><p>Frustrated customers</p><p>Lack of agility</p></li><li><p>Challenges with monolithic software</p><p>Long Build/Test/Release Cycles(who broke the build?)</p><p>Operationsis a nightmare(module X is failing, whos the owner?)</p><p>Difficult to scale</p><p>New releasestake months</p><p>Long time to addnew features</p><p>Architecture is hard to maintain and evolve</p><p>Lack of innovation</p><p>Frustrated customers</p><p>Lack of agility</p></li><li><p>Monolith development lifecycle</p><p>releasetestbuild</p><p>delivery pipeline</p><p>app(aka themonolith)developers</p><p>Photo by Sage Ross. No alterations other than cropping. https://www.flickr.com/photos/ragesoss/2931770125/Image used with permissions under Creative Commons license 2.0, Attribution Generic License (https://creativecommons.org/licenses/by/2.0/)</p></li><li><p>Too much software coupling</p></li><li><p>Too much software coupling</p><p>Shared libraries</p></li><li><p>Too much software coupling</p><p>Shared libraries</p><p>Shared data</p></li><li><p>Evolving towards microservices</p><p>IMG_1760 by Robert Couse-Baker. No alterations other than cropping. https://www.flickr.com/photos/29233640@N07/14859431605/Image used with permissions under Creative Commons license 2.0, Attribution Generic License (https://creativecommons.org/licenses/by/2.0/)</p></li><li><p>IMG_1760 by Robert Couse-Baker. No alterations other than cropping. https://www.flickr.com/photos/29233640@N07/14859431605/Image used with permissions under Creative Commons license 2.0, Attribution Generic License (https://creativecommons.org/licenses/by/2.0/)</p></li><li><p>service-oriented</p><p>architecture</p><p>composed of</p><p>loosely coupled </p><p>elements</p><p>that have</p><p>bounded contexts</p><p>Adrian Cockcroft (VP of Cloud Architecture @ AWS, former Cloud Architect at Netflix)</p></li><li><p>service-oriented</p><p>architecture</p><p>composed of</p><p>loosely coupled </p><p>elements</p><p>that have</p><p>bounded contexts</p><p>Services communicate with each other over the network</p><p>Adrian Cockcroft (VP of Cloud Architecture @ AWS, former Cloud Architect at Netflix)</p></li><li><p>service-oriented</p><p>architecture</p><p>composed of</p><p>loosely coupled </p><p>elements</p><p>that have</p><p>bounded contexts</p><p>You can update the services independently; updating one service doesnt require changing any other services.</p><p>Adrian Cockcroft (VP of Cloud Architecture @ AWS, former Cloud Architect at Netflix)</p></li><li><p>service-oriented</p><p>architecture</p><p>composed of</p><p>loosely coupled </p><p>elements</p><p>that have</p><p>bounded contexts Self-contained; you can update the code without knowing anything about the internals of other microservices</p><p>Adrian Cockcroft (VP of Cloud Architecture @ AWS, former Cloud Architect at Netflix)</p></li><li><p>Do one thing, and do it well</p><p>Swiss Army by by Jim Pennucci. No alterations other than cropping. https://www.flickr.com/photos/pennuja/5363518281/Image used with permissions under Creative Commons license 2.0, Attribution Generic License (https://creativecommons.org/licenses/by/2.0/)</p></li><li><p>Tools by Tony Walmsley: No alterations other than cropping. https://www.flickr.com/photos/twalmsley/6825340663/Image used with permissions under Creative Commons license 2.0, Attribution Generic License (https://creativecommons.org/licenses/by/2.0/)</p><p>Do one thing, and do it well</p></li><li><p>Anatomy of a Microservice</p></li><li><p>Anatomy of a Microservice</p></li><li><p>Data Store(eg, RDS, DynamoDB</p><p>ElastiCache, ElasticSearch)</p><p>Anatomy of a Microservice</p></li><li><p>Application/Logic(code, libraries, etc)</p><p>Anatomy of a Microservice</p><p>Data Store(eg, RDS, DynamoDB</p><p>ElastiCache, ElasticSearch)</p></li><li><p>Public API</p><p>POST /restaurantsGET /restaurants</p><p>Application/Logic(code, libraries, etc)</p><p>Anatomy of a Microservice</p><p>Data Store(eg, RDS, DynamoDB</p><p>ElastiCache, ElasticSearch)</p></li><li><p>Avoid Software Coupling</p></li><li><p>Driversmicroservices</p><p>Paymentsmicroservice Location</p><p>microservices</p><p>Orderingmicroservices</p><p>Restaurantmicroservice</p><p>Ecosystem of Microservices</p></li><li><p>= 50 million deployments a year</p><p>Thousands of teams</p><p> Microservice architecture</p><p> Continuous delivery</p><p> Multiple environments</p><p>(5708 per hour, or every 0.63 second)</p></li><li><p>Gilt: Luxury designer brands at members-only prices</p></li><li><p>... Sale every day at noon EST</p></li><li><p>Microservices Architecture on Amazon Web Services</p></li><li><p>Application Services</p><p>API GatewayBuild, Publish and Manage APIs</p><p> Performance at any scale via worldwide edge locations, traffic </p><p>throttling, and API output caching</p><p> Monitor API activity</p><p> Integrates with Lambda functions</p><p> Run multiple versions of the same API</p><p> Fully Managed</p></li><li><p>Elastic Compute Cloud (EC2)Virtual Servers in the Cloud</p><p> Resizable Compute Capacity</p><p> Complete control of your computing resources</p><p> Reduces time to obtain and boot new server </p><p>instances to minutes</p><p> Choose from 30+ different instance types</p><p> Scale as your requirements change</p><p> Pay only for what you use</p><p>Compute</p></li><li><p>EC2 Container ServiceRun and Manage Docker Containers</p><p> A high performance container management service for </p><p>running Docker containers on EC2 instances</p><p> Use the built in scheduler, write your own, or use a </p><p>third-party scheduler</p><p> Integrates with other services like ELB and EBS</p><p> No additional charge</p><p> EC2 Container Registry </p><p>Compute</p></li><li><p>LambdaRun Code in Response to Events</p><p> Runs code in response to triggers such as S3 upload, </p><p>DynamoDB updates, Kinesis streams, and API </p><p>Gateway requests</p><p> Automatically scales</p><p> You only need to provide the code; there is no </p><p>infrastructure to manage</p><p> Pay only for what you use</p><p>Compute</p></li><li><p>DynamoDBPredictable and Scalable NoSQL Data Store</p><p> Fast, fully-managed NoSQL Database Service</p><p> Capable of handling any amount of data</p><p> Durable and Highly Available</p><p> All SSD storage</p><p> Simple and Cost Effective</p><p>Database</p></li><li><p>Microservices Architecture</p><p>Internet</p><p>Mobile Apps</p><p>Websites</p><p>Services</p><p>AWS Lambda </p><p>functions</p><p>AWS</p><p>API Gateway </p><p>Cache</p><p>Endpoints on </p><p>Amazon EC2 /ECS</p><p>Amazon Elastic </p><p>Beanstalk</p><p>Any other publicly </p><p>accessible endpoint</p><p>Amazon </p><p>CloudWatch </p><p>Monitoring</p><p>Amazon </p><p>API Gateway</p></li><li><p>Principle 1</p><p>Microservices only rely on each others public API</p><p>Contracts by NobMouse. No alterations other than cropping.https://www.flickr.com/photos/nobmouse/4052848608/</p><p>Image used with permissions under Creative Commons license 2.0, Attribution Generic License (https://creativecommons.org/licenses/by/2.0/)</p></li><li><p>Microservice A Microservice B</p><p>public API public API</p><p>Principle 1: Microservices only rely on each others public API</p></li><li><p>public API public API</p><p>Principle 1: Microservices only rely on each others public API(Hide Your Data)</p><p>Microservice A Microservice B</p></li><li><p>public API public API</p><p>Nope!</p><p>Principle 1: Microservices only rely on each others public API(Hide Your Data)</p><p>Microservice A Microservice B</p></li><li><p>public API public API</p><p>Principle 1: Microservices only rely on each others public API(Hide Your Data)</p><p>Microservice A Microservice B</p></li><li><p>Principle 1: Microservices only rely on each others public API(Evolve API in backward-compatible wayand document!)</p><p>storeRestaurant (id, name, cuisine)</p><p>Version 1.0.0</p><p>public API</p><p>Microservice A</p></li><li><p>Principle 1: Microservices only rely on each others public API(Evolve API in backward-compatible wayand document!)</p><p>storeRestaurant (id, name, cuisine)</p><p>storeRestaurant (id, name, cuisine)storeRestaurant (id, name, arbitrary_metadata)addReview (restaurantId, rating, comments)</p><p>Version 1.0.0</p><p>Version 1.1.0</p><p>public API</p><p>Microservice A</p></li><li><p>Principle 1: Microservices only rely on each others public API(Evolve API in backward-compatible wayand document!)</p><p>storeRestaurant (id, name, cuisine)</p><p>storeRestaurant (id, name, cuisine)storeRestaurant (id, name, arbitrary_metadata)addReview (restaurantId, rating, comments)</p><p>storeRestaurant (id, name, arbitrary_metadata)addReview (restaurantId, rating, comments)</p><p>Version 1.0.0</p><p>Version 1.1.0</p><p>Version 2.0.0</p><p>public API</p><p>Microservice A</p></li><li><p>Principle 2</p><p>Use the right tool for the job</p><p>Tools #2 by Juan Pablo Olmo. No alterations other than cropping.https://www.flickr.com/photos/juanpol/1562101472/</p><p>Image used with permissions under Creative Commons license 2.0, Attribution Generic License (https://creativecommons.org/licenses/by/2.0/)</p></li><li><p>public API public API</p><p>Principle 2: Use the right tool for the job(Embrace polyglot persistence)</p><p>DynamoDB</p><p>Microservice A Microservice B</p></li><li><p>public API public API</p><p>Principle 2: Use the right tool for the job(Embrace polyglot persistence)</p><p>DynamoDB</p><p>Microservice A Microservice B</p><p>AmazonElasticsearchService</p></li><li><p>public API public API</p><p>Principle 2: Use the right tool for the job(Embrace polyglot persistence)</p><p>RDSAurora</p><p>Microservice A Microservice B</p><p>AmazonElasticsearchService</p></li><li><p>public API public API</p><p>Principle 2: Use the right tool for the job(Embrace polyglot programming frameworks)</p><p>RDSAurora</p><p>Microservice A Microservice B</p><p>AmazonElasticsearchService</p></li><li><p>public API public API</p><p>Principle 2: Use the right tool for the job(Embrace polyglot programming frameworks)</p><p>RDSAurora</p><p>Microservice A Microservice B</p><p>AmazonElasticsearchService</p></li><li><p>Todays Workshop</p><p>This hands-on workshop will demonstrate the basics of building serverless</p><p>applications and microservices on AWS using AWS Lambda, Amazon DynamoDB, Amazon API Gateway, and more.</p><p>Building Serverless Microservices on AWS</p><p>1:45PM 2:45PM</p></li><li><p>DynamoDB</p><p>Lambdato retrieverestaurants</p><p>Restaurant microservice</p><p>API Gateway</p><p>POST GET</p><p>Lambdato store</p><p>restaurants</p></li><li><p>Principle 3</p><p>Secure Your Services</p><p>security by Dave Bleasdale. No alterations other than cropping.https://www.flickr.com/photos/sidelong/3878741556/</p><p>Image used with permissions under Creative Commons license 2.0,Attribution Generic License (https://creativecommons.org/licenses/by/2.0/)</p></li><li><p>Principle 3: Secure Your Services</p><p> Defense-in-depth Network level (e.g. VPC, Security Groups, TLS) Server/container-level App-level IAM policies</p><p> Gateway (Front door)</p><p> API Throttling</p><p> Authentication &amp; Authorization Client-to-service, as well as service-to-service API Gateway: custom Lambda authorizers IAM-based Authentication Token-based auth (JWT tokens, OAuth 2.0)</p><p> Secrets management S3 bucket policies + KMS + IAM Open-source tools (e.g. Vault, Keywhiz)</p><p>API Gateway</p></li><li><p>Principle 4</p><p>Be a good citizenwithin the ecosystem</p><p>Lamington National Park, rainforest by Jussarian. No alterations other than cropping.https://www.flickr.com/photos/kerr_at_large/87771074/</p><p>Image used with permissions under Creative Commons license 2.0,Attribution Generic License (https://creativecommons.org/licenses/by/2.0/)</p></li><li><p>Hey Sally, we need to call your microserviceto fetch restaurants </p><p>details.</p><p>Sure Paul. Which APIs you need to call? Once I know </p><p>better your use cases Ill give you permission to register </p><p>your service as a client on our services directory entry.</p><p>Microservice A Microservice B</p><p>public API public API</p><p>Principle 4: Be a good citizen within the ecosystem</p></li><li><p>Principle 4: Be a good citizen within the ecosystem(Have clear SLAs) </p><p>Restaurantmicroservice</p><p>15 TPS100 TPS5 TPS20 TPS</p><p>Before we let you call our microservice we </p><p>need to understand your use case, expected load </p><p>(TPS) and accepted latency</p></li><li><p>and many,many others!</p><p>Distributed monitoring and tracing Is the service meeting its SLA? Which services were involved in a request? How did downstream dependencies perform?</p><p>Shared metrics e.g. request time, time to first byte</p><p>Distributed tracing e.g. Zipkin, OpenTracing</p><p>User-experience metrics</p><p>Principle 4: Be a good citizen within the ecosystem(Distributed monitoring, logging and tracing) </p></li><li><p>Principle 5</p><p>More than justtechnology transformation</p><p>rowing on the river in Bedford by Matthew Hunt. No alterations other than cropping.https://www.flickr.com/photos/mattphotos/19189529/</p><p>Image used with permissions under Creative Commons license 2.0,Attribution Generic License (https://creativecommons.org/licenses/by/2.0/)</p></li><li><p>Any organization that designs a system will inevitably produce a design whose structure is a copy of the organizationscommunication structure.</p><p>Melvin E. Conway, 1967</p><p>Conways Law</p></li><li><p>Silod functional teams silod application architectures</p><p>Image from Martin Fowlers article on microservices, athttp://martinfowler.com/articles/microservices.html</p><p>No alterations other than cropping.Permission to reproduce: http://martinfowler.com/faq.html</p></li><li><p>Silod functional teams silod application architectures</p><p>Image from Martin Fowlers article on microservices, athttp://martinfowler.com/articles/microservices.html</p><p>No alterations other than cropping.Permission to reproduce: http://martinfowler.com/faq.html</p></li><li><p>Cross functional teams self-contained services</p><p>Image from Martin Fowlers article on microservices, athttp://martinfowler....</p></li></ul>

Recommended

View more >