Upload
indicthreads
View
287
Download
2
Tags:
Embed Size (px)
Citation preview
Monolith Application
UI Database
Business Logic
HTMLHTMLHTML
CSSCSS
HTMLHTMLCDIHTMLHTMLREST
HTMLHTMLJSF
HTMLHTMLJPA Cache
DB
Monolith Application
UI Database
Business Logic
HTMLHTMLHTML
CSSCSS
HTMLHTMLCDIHTMLHTMLREST
HTMLHTMLJSF
HTMLHTMLJPA Cache
DB
Monolith Application
UI Database
Business Logic
HTMLHTMLHTML
CSSCSS
HTMLHTMLCDIHTMLHTMLREST
HTMLHTMLJSF
HTMLHTMLJPALoad
BalancerCache
DB
Advantages of Monolith Application
• Typically packaged in a single .ear
• Easy to test (all required services are up)
Advantages of Monolith Application
• Typically packaged in a single .ear
• Easy to test (all required services are up)
• Simple to develop
Monolith ApplicationUI Database
Business Logic
HTMLHTML
HTMLHTML HTMLHTML HTMLHTML
HTMLHTML
Version 1
Monolith ApplicationUI Database
Business Logic
HTMLHTML
HTMLHTML HTMLHTML HTMLHTML
HTMLHTML
Version 1
UI Database
Business Logic
HTMLHTML
HTMLHTML HTMLHTML HTMLHTML
HTMLHTML
Version 2
Monolith ApplicationUI Database
Business Logic
HTMLHTML
HTMLHTML HTMLHTML HTMLHTML
HTMLHTML
Version 1
UI Database
Business Logic
HTMLHTML
HTMLHTML HTMLHTML HTMLHTML
HTMLHTML
Version 2
UI Database
Business Logic
HTMLHTML
HTMLHTML HTMLHTML HTMLHTML
HTMLHTML
Version 3
Monolith ApplicationUI Database
Business Logic
HTMLHTML
HTMLHTML HTMLHTML HTMLHTML
HTMLHTML
Version 1
UI Database
Business Logic
HTMLHTML
HTMLHTML HTMLHTML HTMLHTML
HTMLHTML
Version 2
UI Database
Business Logic
HTMLHTML
HTMLHTML HTMLHTML HTMLHTML
HTMLHTML
Version 3
UI Database
Business Logic
HTMLHTML
HTMLHTML HTMLHTML HTMLHTML
HTMLHTML
Version 4
Disadvantages of Monolith Application
• Difficult to deploy and maintain
• Obstacle to frequent deployments
Disadvantages of Monolith Application
• Difficult to deploy and maintain
• Obstacle to frequent deployments
• Makes it difficult to try out new technologies/framework
–Martin Fowler
“building applications as suites of services. As well as the fact that services are independently deployable and scalable, each service also provides a firm module boundary, even allowing for different services to be written in different programming languages. They can also be managed by different teams”
http://martinfowler.com/articles/microservices.html
UI
Business Logic
Persistence
Orders
Shipping
Catalog
Characteristics of microservices
👱 🙍🙍👱👱
👱 🙍🙍👱👱
👱 🙍🙍👱👱
UI
Business Logic
Persistence
Orders
Shipping
Catalog
Characteristics of microservices
👱 🙍🙍👱👱
👱 🙍🙍👱👱
👱 🙍🙍👱👱
UI
Business Logic
Persistence
Orders
Shipping
Catalog
Characteristics of microservices
👱 🙍🙍👱👱
👱 🙍🙍👱👱
👱 🙍🙍👱👱
UI
Business Logic
Persistence
Orders
Shipping
Catalog
Characteristics of microservices
👱 🙍🙍👱👱
👱 🙍🙍👱👱
👱 🙍🙍👱👱
–Melvin Conway
“Any organization that designs a system (defined more broadly here than just information
systems) will inevitably produce a design whose structure is a copy of the
organization's communication structure.”
http://www.melconway.com/Home/Committees_Paper.html
Designed for failure
Fault tolerance is a requirement, not a feature
http://techblog.netflix.com/2012/02/fault-tolerance-in-high-volume.html
Characteristics
Strategies for decomposing
• Verb or usecase - e.g. Checkout UI
• Noun - e.g. Catalog product service
Strategies for decomposing
• Verb or usecase - e.g. Checkout UI
• Noun - e.g. Catalog product service
• Single Responsible Principle - e.g. Unix utilities
Service C
WAR
Service B
WAR
Aggregator Pattern #1
DBCache
Service A
WARDBCache
DBCacheAggregator
LoadBalancer
Service C
WAR
Service B
WAR
Aggregator Pattern #1
DBCache
Service A
WARDBCache
DBCacheAggregator
LoadBalancer
Service C
WAR
Service B
WAR
Aggregator Pattern #1
DBCache
Service A
WARDBCache
DBCacheAggregator
LoadBalancer
Aggregator
Service C
WAR
Service B
WAR
Aggregator Pattern #1
DBCache
Service A
WARDBCache
DBCacheAggregator
LoadBalancer
Service C
WAR
Service B
WAR
Proxy Pattern #1.5
DBCache
Service A
WARDBCache
DBCacheProxy
LoadBalancer
Service C
WAR
Service B
WAR
Proxy Pattern #1.5
DBCache
Service A
WARDBCache
DBCacheProxy
LoadBalancer
Service C
WAR
Service B
WAR
Proxy Pattern #1.5
DBCache
Service A
WARDBCache
DBCacheProxy
LoadBalancer
Branch Pattern #3
Service A
WAR
DBCache
LoadBalancer Service B
WAR
DBCache
Service D
WAR
DBCache
Service C
WAR
DBCache
Shared Resources #4Service B
WAR
DBCache
Service C
WAR
Service D
WAR
DBCache
Service A
WAR
DBCache
LoadBalancer
Async Messaging #5Service B
WAR
DBCache
Service C
WAR
Service D
WAR
DBCache
Queue
DBCache
Service A
WAR
DBCache
LoadBalancer
Advantages of microservices
• Easier to develop, understand, maintain
• Starts faster than a monolith, speeds up deployments
Advantages of microservices
• Easier to develop, understand, maintain
• Starts faster than a monolith, speeds up deployments
• Local change can be easily deployed, great enabler of CD
Advantages of microservices
• Easier to develop, understand, maintain
• Starts faster than a monolith, speeds up deployments
• Local change can be easily deployed, great enabler of CD
• Each service can scale on X- and Y-axis
Advantages of microservices
• Easier to develop, understand, maintain
• Starts faster than a monolith, speeds up deployments
• Local change can be easily deployed, great enabler of CD
• Each service can scale on X- and Y-axis
• Improves fault isolation
Advantages of microservices
• Easier to develop, understand, maintain
• Starts faster than a monolith, speeds up deployments
• Local change can be easily deployed, great enabler of CD
• Each service can scale on X- and Y-axis
• Improves fault isolation
• Eliminates any long-term commitment to a technology stack
Advantages of microservices
• Easier to develop, understand, maintain
• Starts faster than a monolith, speeds up deployments
• Local change can be easily deployed, great enabler of CD
• Each service can scale on X- and Y-axis
• Improves fault isolation
• Eliminates any long-term commitment to a technology stack
• Freedom of choice of technology, tools, frameworks
“If you can't build a [well-structured] monolith, what makes you think microservices are the answer?”
http://www.codingthearchitecture.com/2014/07/06/distributed_big_balls_of_mud.html
Drawbacks of microservices
• Additional complexity of distributed systems
• Significant operational complexity, need high-level of automation
Drawbacks of microservices
• Additional complexity of distributed systems
• Significant operational complexity, need high-level of automation
• Rollout plan to coordinate deployments
Drawbacks of microservices
• Additional complexity of distributed systems
• Significant operational complexity, need high-level of automation
• Rollout plan to coordinate deployments
• Slower ROI, to begin with
“Ops” job is NOT to keep the site stable and fast
“Ops” job is to enable business
And so is “devs”
36
Is DevOps for you?
https://puppetlabs.com/wp-content/uploads/2013/03/2013-state-of-devops-report.pdf
Five “C”s of DevOps• Collaboration between “dev” and “ops”
• Culture
• Code everything - application and configuration
Five “C”s of DevOps• Collaboration between “dev” and “ops”
• Culture
• Code everything - application and configuration
• Consistency - automation over documentation
Five “C”s of DevOps• Collaboration between “dev” and “ops”
• Culture
• Code everything - application and configuration
• Consistency - automation over documentation
• Continuous delivery
Collaboration• “Dev”
• Engineering
• Test
• Product management
• “Ops”
• System administrators
• Operations staff
• DBAs
• Network engineers
• Security professionals
Collaboration• “Dev”
• Engineering
• Test
• Product management
• “Ops”
• System administrators
• Operations staff
• DBAs
• Network engineers
• Security professionals
Culture
• Respect other’s expertise, opinions, responsibilities
• Trust: Ops to think like devs, devs to think like ops
Culture
• Respect other’s expertise, opinions, responsibilities
• Trust: Ops to think like devs, devs to think like ops
• Leads to transparency
Culture
• Respect other’s expertise, opinions, responsibilities
• Trust: Ops to think like devs, devs to think like ops
• Leads to transparency
• Don’t ignore failure, build joint recovery plans
Culture
• Respect other’s expertise, opinions, responsibilities
• Trust: Ops to think like devs, devs to think like ops
• Leads to transparency
• Don’t ignore failure, build joint recovery plans
• Amplify feedback loops
http://www.slideshare.net/jallspaw/10-deploys-per-day-dev-and-ops-cooperation-at-flickr
http://www.slideshare.net/jallspaw/10-deploys-per-day-dev-and-ops-cooperation-at-flickr
http://www.slideshare.net/jallspaw/10-deploys-per-day-dev-and-ops-cooperation-at-flickr
“Treat people warmly, issues coldly!”
Code everything• Application code
• Build scripts
• Database schema
• Configuration files
• IDE configurations
• Infrastructure
• Deployment scripts
• Test code and scripts
• Provisioning scripts
• Monitoring
• Logging
• …
Consistency• Automation over documentation
• Repeatability
• Push-button deployments
• Managing environments
Dev
Test
Prod
Consistency• Automation over documentation
• Repeatability
• Push-button deployments
• Managing environments
Dev
Test
Prod
Manage environments• Cloud computing: PaaS, OpenShift, …
• Virtualization: Virtual Box, Vagrant, …
• Containers: Docker, Rocket, …
• App server: JBoss EAP, Tomcat, …
• Configuration tools: Puppet, Chef, Ansible, Salt, ...
• Orchestration: Kubernetes, Swarm, …
Continuous Delivery• Agile Manifesto
• Continuous Integration
• Fail fast and recover
• Self service
Continuous Delivery• Agile Manifesto
• Continuous Integration
• Fail fast and recover
• Self service
• 100% Automation
Continuous Delivery• Agile Manifesto
• Continuous Integration
• Fail fast and recover
• Self service
• 100% Automation
• Proactive monitoring and metrics
BuildTest
Deploy
Continuous Integration
Release
Build
Test
Deploy
ManualAcceptance
Continuous Delivery
BuildTest
Deploy
Continuous Integration
Release
Build
Test
Deploy
ManualAcceptance
Continuous Delivery
Release
Build
Test
Deploy
Continuous Deployment
Initial Managed Defined Quantitatively Managed Optimizing
Culture & Organization
• Teams organized based on platform/technology
• Defined and documented processes
• One backlog per team
• Adopt agile methodologies
• Remove team boundaries
• Extended team collaboration
• Remove boundary dev/ops
• Common process for all changes
• Cross-team continuous improvement
• Teams responsible all the way to production
• Cross functional teams
Build & Deploy
• Centralized version control
• Automated build scripts
• No management of artifacts
• Manual deployment • Environments are
manually provisioned
• Polling CI builds • Any build can be
re-created from source control
• Management of build artifacts
• Automated deployment scripts
• Automated provisioning of environments
• Commit hook CI builds • Build fails if quality is not
met (code analysis, performance, etc.)
• Push button deployment and release of any releasable artifact to any environment
• Standard deployment process for all environments
• Team priorities keeping codebase deployable over doing new work
• Builds are not left broken • Orchestrated deployments • Blue Green Deployments
• Zero touch Continuous Deployments
Release• Infrequent and
unreliable releases • Manual process
• Painful infrequent but reliable releases
• Infrequent but fully automated and reliable releases in any environment
• Frequent fully automated releases
• Deployment disconnected from release
• Canary releases
• No rollbacks, always roll forward
Data Management
• Data migrations are performed manually, no scripts
• Data migrations using versioned scripts, performed manually
• Automated and versioned changes to datastores
• Changes to datastores automatically performed as part of the deployment process
• Automatic datastore changes and rollbacks tested with every deployment
Test & Verification
• Automated unit tests • Separate test
environment
• Automatic Integration Tests
• Static code analysis
• Test coverage analysis
• Automatic functional tests
• Manual performance/security tests
• Fully automatic acceptance tests
• Automatic performance/security tests
• Manual exploratory testing based on risk based testing analysis
• Verify expected business value
• Defects found and fixed immediately (roll forward)
Information & Reporting
• Baseline process metrics
• Manual reporting • Visible to report
runner
• Measure the process
• Automatic reporting • Visible to team
• Automatic generation of release notes
• Pipeline traceability • Reporting history • Visible to cross-silo
• Report trend analysis • Real time graphs on deployment
pipeline metrics
• Dynamic self-service of information
• Customizable dashboards • Cross-reference across
organizational boundaries