Beruflich Dokumente
Kultur Dokumente
patterns blueprints
Rohit Bhardwaj
• Fraud Detection
availability
operational cost per trip
response time
https://creately.com/jupiter/diagram/image/ihsiv6cf1
http://microservices.io/patterns/apigateway.html
http://www.powderfool.com/wp-content/uploads/2015/08/2a0b6d5.jpg
twitter
https://media.licdn.com/mpr/mpr/p/6/005/048/236/071c448.jpg
scalability challenge
Traditional Solutions
3 TIER ATCHITECTURE
MULTI-TIERED APP
Dockers
• You need the IP of this first container to pass as a parameter to subsequent containers
http://www.cloudcomputingpatterns.org/
Cloud offerings
http://www.cloudcomputingpatterns.org/
Cloud App Architectures
http://www.cloudcomputingpatterns.org/
Cloud Application
Management
Principle 1: Resilient to
Failure
http://cdn3.positivepsychologyprogram.com/wp-content/uploads/2013/12/resilience-in-positive-psychology-.jpg
Vulnerabilities
• Degraded functionality
Loose coupling
• Automatic sync
Principle 2: Resilient to
Latency
http://officeoffinance.com/wp-content/uploads/2014/02/tenancy.png
Issue: Infrastructure failures
causing delays
• Network congestion or network partition
https://media.licdn.com/mpr/mpr/p/6/005/048/236/071c448.jpg
Issue: Latency between
New York and San Francisco
• 13.8 ms
• As per AT&T: 70 ms
Distance, as the crow flies, between New York and San Francisco =
2,565 miles; speed of light = 186,000 miles/second.
Service A depends on B
which depends on C
http://www.stratoscale.com/wp-content/uploads/imageblog14.2.png
Solution 1: Co-locate
http://associationnow.wpengine.netdna-cdn.com/wp-content/uploads/2012/09/0928_team-800x480.jpg
Solution 2: Reducing the
number of network requests
http://techblog.netflix.com/2013/01/optimizing-netflix-api.html
Principle 3: Secure
http://mobileapplicationdeveloperscompany.weebly.com/uploads/3/9/9/2/39922959/8888446_orig.jpg
Solution 1: Secure data in
transit
http://underpop.online.fr/j/java/intro/ror/ssh/figs/ssh_0102.gif
Solution 2: Control API
Access
Threat modeling
Principle 4: Location
Independent
Solution 1: No hardcoded
config: End point addresses
http://www.telerik.com/sfimages/default-source/blogs/not-hard-coded-jpg-jpg
Solution 2: Register service
http://mesosphere.github.io/presentations/hackers-at-berkeley-2015/assets/mesos-animation/mesos-marathon-animation_23b.png
http://mesos.apache.org/documentation/latest/architecture/
Solution 3: Application
components should be stateless
https://cldup.com/YgsLg7gM2L.png
Solution 4: Applications should
use established protocols
• HTTPS
• Dockers
Solution 5: API management
through proxy
http://microservices.io/patterns/apigateway.html
Principle 5: Elastically
Scalable
https://cloud.google.com/solutions/images/scaling-capacity-to-meet-demand.png
Principle 6: SOA/Compose-
ability
Provide APIs that return just the data the consumer needs (“partial
response”).
Consider data compression, but balance against CPU costs for encoding
and decoding.
Minimize data transfers
https://github.com/mstine/2016_CloudNativeAppArchWorkshop
https://github.com/Netflix/Hystrix/tree/master/hystrix-dashboard
CIRCUIT BREAKER DESIGN
PATTERN
• Benefits
• Increased scalability
https://github.com/Netflix/eureka/wiki/Eureka-at-a-glance
Service benefits
https://www.martinfowler.com/articles/serverless.html
AWS Lambda
https://aws.amazon.com/lambda/
Open Tracing
http://opentracing.io/documentation/
Open Tracing
AWS Device Farm
https://aws.amazon.com/device-farm/
Microservices Design
Pattern
http://martinfowler.com/articles/microservices/images/decentralised-
data.png
MICROSERVICES DESIGN
PATTERN
• Benefits
• Enables elasticity
• To improve performance
• Reliability
• Scalability
• Visibility
• Redeploy / Startup
External Configuration Store
Runtime Reconfiguration: No
downtime
https://imasaikirangeek.files.wordpress.com/2014/05/defining-big-data1.png
Database Sharding design
replication
CAP Theorem
• http://start.spring.io/
The Twelve Factors
Factor 1: Codebase
• Repeatable deployment
Factor 3: Config
• Store config in the environment, no properties files
...
import org.springframework.context.EnvironmentAware;
import org.springframework.core.env.Environment;
@RestController
public class HelloController implements EnvironmentAware {
private String name;
@Override
public void setEnvironment(Environment environment) {
this.name = environment.getProperty("who");
} ...
Factor 4: Backing Services
Factor 5: Build, release, run
• Share nothing
• No Sticky sessions
Factor 7: Port binding
In application.yml
logging:
level:
org.springframework: ${SPRING_LOG_LEVEL:INFO}
hello: ${LOG_LEVEL:INFO}
Factor 12: Admin processes
Microservices
http://www.opendatacenteralliance.org/docs/
architecting_cloud_aware_applications.pdf
www.modsummit.com
www.developersummit.com