Design Patterns Cloud Sharath Feb
2 Agenda Introduction Overview of Cloud design patterns Demo Q/A
About Pivotal 3
Structured PaaS Framework Contract: Cloud Native App Contract: BOSH Release Contract: Cloud Provider Interface Culture Dev IT Ops Application Framework Runtime Platform Infrastructure Automation Infrastructure IT Ops Tools Spring Boot BOSH 4
Cloud Foundry is… The open source application platform-as-a-service. Supported by dozens of major organizations Language and framework agnostic Manages both VMs and containers Orchestrates both applications and data services Abstracts Infrastructure Founded and commercialized by Pivotal, Inc.
The Cloud Foundry Foundation: An Open Industry Standard Transferred from VMWare to Pivotal 1 trillion dollars in market cap supporting the project Governance passed to Cloud Foundry Foundation
CF Meetup in St Louis 7 To Learn more about Cloud Foundry visit the CF MeetupCF Meetup Next meetup is on Feb 16. Presentation by Kenny Bastani. Spring Developer advocate and author.
Design Patterns 1.Microservices 2.Abstraction 3.Twelve Factor 4.Service Registry 5.Config Server 6.Circuit Breaker
Tomcat Monolithic Architecture Browser Apache Inventory Service DB Accounting Service Store Front UI
DEFINE: Microservice Loosely coupled service oriented architecture with bounded contexts If every service has to be updated in concert, it’s not loosely coupled! If you have to know about surrounding services you don’t have a bounded context.
Microservices 11
Scaling Monolith Vs Microservices 12
Enabling Continuous Delivery Product Mgr UXDevQADBA Sys Admin Net Admin Storage Admin BUSINESS CAPABILITY TEAMS USING MICROSERVICES PLATFORM OPERATIONS TEAM Self Service API Adapted from:
Abstraction Agility and Cost Savings Traditional Storage Servers Networking O/S Middleware Virtualization Data Application Runtime You Manage O/S IaaS Servers Networking Middleware Virtualization Data Application Runtime You Manage IaaS Provider You Manage O/S Cloud Native Servers Networking Middleware Virtualization Data Application Runtime Pivotal Cloud Foundry Container Automation
Twelve Factor Apps – 12factor.net12factor.net 15
Example Distributed System:
Example: Spring Cloud + Netflix OSS
Config Server
Service Registration/Discovery
@SpringBootApplication public class CustomerApp extends RepositoryRestMvcConfiguration protected void configureRepositoryRestConfiguration(RepositoryRestConfiguration config) { config.exposeIdsFor(Customer.class); } public static void main(String[] args) { SpringApplication.run(CustomerApp.class, args); }
Fault Tolerance – Circuit Breakers
@SpringBootApplication public class CustomerApp extends RepositoryRestMvcConfiguration protected void configureRepositoryRestConfiguration(RepositoryRestConfiguration config) { config.exposeIdsFor(Customer.class); } public static void main(String[] args) { SpringApplication.run(CustomerApp.class, args); }
Fallback = "sayHelloFallback") public String sayHello(String toWho) { try{ return restTemplate.getForObject(" String.class, toWho); } catch (Exception e) { e.printStackTrace(); throw e; } public String sayHelloFallback(String toWho) { return String.format("Error, can't say hello to %s", toWho); }
Resources Link to video of Spring Cloud Service demo – Sharath Sahadevan Spring boot code is available at: Microservices – Martin Fowler Getting started with Spring Cloud – Josh Long Building Microservices – Sam Newman Spring Cloud project at Spring.io Migrating to Cloud Native Architectures – Matt Stine run.pivotal.io - Sign up for a free account and learn more about Pivotal Cloud Foundry STL CF Meetup – Monthly meetings in ST Louis. Next meeting on Tue Feb 16, 2016 Link to video Microservices Getting started with Spring Cloud Building Microservices Spring Cloud Migrating to Cloud Native Architectures run.pivotal.io STL CF Meetup
Demo’s
Let’s build something MEANINGFUL 26
Thank you 27