Containers and Microservices for realists · PDF file• Rise of Microservices, ......

53
Containers & Microservices For Realists Karthik Gaekwad @iteration1

Transcript of Containers and Microservices for realists · PDF file• Rise of Microservices, ......

Page 1: Containers and Microservices for realists · PDF file• Rise of Microservices, ... Firebase), authentication services (Auth0, AWS Cognito), ... is run in stateless compute containers

Containers & Microservices For Realists

Karthik Gaekwad @iteration1

Page 2: Containers and Microservices for realists · PDF file• Rise of Microservices, ... Firebase), authentication services (Auth0, AWS Cognito), ... is run in stateless compute containers

• Principal Member of Technical Staff • Oracle Container Cloud Team

• Previous:

• 10 years building cloud products

• Enterprise/Startup experience

Karthik Gaekwad @iteration1

Page 3: Containers and Microservices for realists · PDF file• Rise of Microservices, ... Firebase), authentication services (Auth0, AWS Cognito), ... is run in stateless compute containers

• Community Involvement (Austin):

• Devopsdays Core Organizer • Container Days Core Organizer • Cloud Austin

• Docker Austin meetup • The most popular docker helloworld image:

dockerhub.com/karthequian/helloworld

Karthik Gaekwad @iteration1

Page 4: Containers and Microservices for realists · PDF file• Rise of Microservices, ... Firebase), authentication services (Auth0, AWS Cognito), ... is run in stateless compute containers

Audience Survey

Page 5: Containers and Microservices for realists · PDF file• Rise of Microservices, ... Firebase), authentication services (Auth0, AWS Cognito), ... is run in stateless compute containers

Overview• The Evolution of DevOps

• Rise of Microservices, Containers & Serverless applications

• What are they?

• Why should you care?

• What are they used for?

• What’s Oracle doing in this space?

Page 6: Containers and Microservices for realists · PDF file• Rise of Microservices, ... Firebase), authentication services (Auth0, AWS Cognito), ... is run in stateless compute containers

Evolution of Devops• Devops at least officially 8 years old

• Velocity 2009:

• 10 Deploys a day at flickr by John Allspaw, Paul Hammond

• Agile Infrastructure openspace: Andrew Shaefer & Patrick Debois

• 2009: 1st Devopsdays conference, Ghent

• Today: ~150 official devopsdays conference

Page 7: Containers and Microservices for realists · PDF file• Rise of Microservices, ... Firebase), authentication services (Auth0, AWS Cognito), ... is run in stateless compute containers

Evolution of Devops

Page 8: Containers and Microservices for realists · PDF file• Rise of Microservices, ... Firebase), authentication services (Auth0, AWS Cognito), ... is run in stateless compute containers

CULTURE

MEASUREMENT

AUTOMATION

SHARING

Evolution of Devops

John Willis

Damon Edwards

By:

Page 9: Containers and Microservices for realists · PDF file• Rise of Microservices, ... Firebase), authentication services (Auth0, AWS Cognito), ... is run in stateless compute containers

Evolution of Devops

“System administrators participating in an agile development process alongside developers and using many of the same agile techniques for their systems work.”

The Agile Admin Blog

Well Defined:

Page 10: Containers and Microservices for realists · PDF file• Rise of Microservices, ... Firebase), authentication services (Auth0, AWS Cognito), ... is run in stateless compute containers

Evolution of Devops• Training classes available:

• Devops Fundamental Course

• You can even get certified!

• AWS Certified Devops Engineer

• RedHat Certified Devops Architect

• Devops Foundations by the Devops institute

Page 11: Containers and Microservices for realists · PDF file• Rise of Microservices, ... Firebase), authentication services (Auth0, AWS Cognito), ... is run in stateless compute containers

Containers & Microservices

…The next phase of Devops

Page 12: Containers and Microservices for realists · PDF file• Rise of Microservices, ... Firebase), authentication services (Auth0, AWS Cognito), ... is run in stateless compute containers

Containers & Microservices

• Containers and Microservices fit the devops paradigm!

• Microservices allows developers to build applications in modular way

• Allows for containerization • Containerization allows for collaboration

between dev and ops • Common language spoken between 2

teams in an org

Page 13: Containers and Microservices for realists · PDF file• Rise of Microservices, ... Firebase), authentication services (Auth0, AWS Cognito), ... is run in stateless compute containers

Microservices

“Independent processes communicating with each other with well defined API’s to form

larger more complex applications”

Page 14: Containers and Microservices for realists · PDF file• Rise of Microservices, ... Firebase), authentication services (Auth0, AWS Cognito), ... is run in stateless compute containers

Microservices

• Do one thing, and do it well (fine grained)

• Independently built- common language to communicate

• Independently deployable • Fault tolerant and reliable

Page 15: Containers and Microservices for realists · PDF file• Rise of Microservices, ... Firebase), authentication services (Auth0, AWS Cognito), ... is run in stateless compute containers

12 Factor App•Use declarative formats for setup automation;

minimize time and cost for new developers joining the project

•Clean contract with the underlying OS, offering maximum portability between execution environments;

•Suitable for deployment on modern cloud platforms •Minimize divergence between development and

production- enabling continuous deployment •Scale up without significant changes to tooling,

architecture, or development practices.

Page 16: Containers and Microservices for realists · PDF file• Rise of Microservices, ... Firebase), authentication services (Auth0, AWS Cognito), ... is run in stateless compute containers

Relationship with containers• Microservices and containers are a

great fit. • Single service on a container:

• Isolates service and makes it easy to manage and debug.

• Best practice for new architectures with containers.

• Consider building your architecture in this manner.

Page 17: Containers and Microservices for realists · PDF file• Rise of Microservices, ... Firebase), authentication services (Auth0, AWS Cognito), ... is run in stateless compute containers

Containerization

• Strong collaboration between dev and ops.

• Initially championed by developers, and now well liked by operations as well.

Page 18: Containers and Microservices for realists · PDF file• Rise of Microservices, ... Firebase), authentication services (Auth0, AWS Cognito), ... is run in stateless compute containers

Containerization

• Strong collaboration between dev and ops.

• Initially championed by developers, and now well liked by operations as well.

Page 19: Containers and Microservices for realists · PDF file• Rise of Microservices, ... Firebase), authentication services (Auth0, AWS Cognito), ... is run in stateless compute containers

Fundamentals• Portability

• Standardized Environments

• Scaling

• Pipeline building

• Dependency Management

Page 20: Containers and Microservices for realists · PDF file• Rise of Microservices, ... Firebase), authentication services (Auth0, AWS Cognito), ... is run in stateless compute containers

Portability•Idea of writing once and running anywhere.•As long as your application is Dockerized,

you can run it anywhere that has the Docker Engine installed.

•Easy to change from 1 host to another.•Flexibility to change underlying

infrastructure/operating systems etc.•Change from 1 cloud provider to another.

Page 21: Containers and Microservices for realists · PDF file• Rise of Microservices, ... Firebase), authentication services (Auth0, AWS Cognito), ... is run in stateless compute containers

Standardization• Coding environments can be made consistent

from development ->staging->QA->production.• Per environment configurations are fed in the

same way to each container which reduces configuration issues.

• Time spent debugging environmental issues is reduced drastically.

• Developers understand the production environment better, which leads to better code quality.

Page 22: Containers and Microservices for realists · PDF file• Rise of Microservices, ... Firebase), authentication services (Auth0, AWS Cognito), ... is run in stateless compute containers

Scaling

•Containers take seconds to deploy.•Scale up and down your infrastructure

is a lot faster than traditional configuration management tools.

Page 23: Containers and Microservices for realists · PDF file• Rise of Microservices, ... Firebase), authentication services (Auth0, AWS Cognito), ... is run in stateless compute containers

Continuous Delivery•Docker API’s and Docker Hub make it

easy to build a deployment pipeline.•After successful builds, a CI system

can build and push a Docker image to the Hub/private Docker repo.

•Deploy new containers to desired environment on a periodic basis/trigger webhooks to deploy.

Page 24: Containers and Microservices for realists · PDF file• Rise of Microservices, ... Firebase), authentication services (Auth0, AWS Cognito), ... is run in stateless compute containers

Dependency Management• Dependency hell happens when:

• 2 running Java or Ruby applications that depend on different versions of the same library…..

• How Docker can help:

• Isolate each application (along with it’s dependencies) so that they can be loaded in their own container.

• 1 container for 1 application or service (micro service architecture)

Page 25: Containers and Microservices for realists · PDF file• Rise of Microservices, ... Firebase), authentication services (Auth0, AWS Cognito), ... is run in stateless compute containers

Real World Examples

Page 26: Containers and Microservices for realists · PDF file• Rise of Microservices, ... Firebase), authentication services (Auth0, AWS Cognito), ... is run in stateless compute containers

Standardization• Take existing (or new) applications, containerize them, run them the

same way on dev/stage/production.

• Examples on Docker.com: Orbitz, Uber

• Typical scenarios:

• Infrastructure/Applications run in containers.

• Every code push builds a new container for the application.

• All environments uses the same command to run the application:

• sudo docker run -d -p 7777:7777 -e SE_DB=‘db_val’ karthequian/helloworld

Page 27: Containers and Microservices for realists · PDF file• Rise of Microservices, ... Firebase), authentication services (Auth0, AWS Cognito), ... is run in stateless compute containers

CI/CD Pipeline• Most common usecase of how people use Docker today.

• Examples on Docker.com: Business Insider, Spotify, Yelp

• Typical Trend:

• Code is commit to github; triggers a build with CI system.

• Successful build results in a built container that is deployed to a private registry.

• Successful push to registry triggers a webhook (swarm/kubernetes).

• new container is redeployed on production.

• <10 minute turnaround from commit->running in production.

Page 28: Containers and Microservices for realists · PDF file• Rise of Microservices, ... Firebase), authentication services (Auth0, AWS Cognito), ... is run in stateless compute containers

Multi tenancy applications

•Single Tenant application-> Multi tenant application by launching multiple instances of the same application in different containers.

•http://flux7.com/docker/

Page 29: Containers and Microservices for realists · PDF file• Rise of Microservices, ... Firebase), authentication services (Auth0, AWS Cognito), ... is run in stateless compute containers

Other Usecases•Running a PaaS

•Running entire datacenters using Docker.

•EngineYard/Yandex/Baidu are great examples of this.

•Hosting Legacy Applications

•Containerizing hard to run applications is becoming a frequent usecase.

Page 30: Containers and Microservices for realists · PDF file• Rise of Microservices, ... Firebase), authentication services (Auth0, AWS Cognito), ... is run in stateless compute containers

Docker Trends• 2 great surveys:

• Datadog docker adoption: https://www.datadoghq.com/docker-adoption/

• devops.com & ClusterHQ survey: https://clusterhq.com/assets/pdfs/state-of-container-usage-june-2016.pdf

Page 31: Containers and Microservices for realists · PDF file• Rise of Microservices, ... Firebase), authentication services (Auth0, AWS Cognito), ... is run in stateless compute containers

Source: devops.com and clusterHQ survey 2016

Page 32: Containers and Microservices for realists · PDF file• Rise of Microservices, ... Firebase), authentication services (Auth0, AWS Cognito), ... is run in stateless compute containers

2016: 10.8% of all Datadog customers use Docker (up from 8.2% in 2015)

Page 33: Containers and Microservices for realists · PDF file• Rise of Microservices, ... Firebase), authentication services (Auth0, AWS Cognito), ... is run in stateless compute containers

10% of all Datadog hosts have Docker running

Page 34: Containers and Microservices for realists · PDF file• Rise of Microservices, ... Firebase), authentication services (Auth0, AWS Cognito), ... is run in stateless compute containers
Page 35: Containers and Microservices for realists · PDF file• Rise of Microservices, ... Firebase), authentication services (Auth0, AWS Cognito), ... is run in stateless compute containers

Orchestration

Source: devops.com and clusterHQ survey 2016

Page 36: Containers and Microservices for realists · PDF file• Rise of Microservices, ... Firebase), authentication services (Auth0, AWS Cognito), ... is run in stateless compute containers

Serverless Applications

• What is it?

Page 37: Containers and Microservices for realists · PDF file• Rise of Microservices, ... Firebase), authentication services (Auth0, AWS Cognito), ... is run in stateless compute containers

Serverless Applications

Page 38: Containers and Microservices for realists · PDF file• Rise of Microservices, ... Firebase), authentication services (Auth0, AWS Cognito), ... is run in stateless compute containers

Serverless Applications• Serverless was first used to describe applications that

significantly or fully depend on 3rd party applications / services (‘in the cloud’) to manage server-side logic and state. These are typically ‘rich client’ applications (think single page web apps, or mobile apps) that use the vast ecosystem of cloud accessible databases (like Parse, Firebase), authentication services (Auth0, AWS Cognito), etc. These types of services have been previously described as ‘(Mobile) Backend as a Service’, and I’ll be using ‘BaaS’ as a shorthand in the rest of this article.

Page 39: Containers and Microservices for realists · PDF file• Rise of Microservices, ... Firebase), authentication services (Auth0, AWS Cognito), ... is run in stateless compute containers

Serverless Applications• Serverless can also mean applications where some

amount of server-side logic is still written by the application developer but unlike traditional architectures is run in stateless compute containers that are event-triggered, ephemeral (may only last for one invocation), and fully managed by a 3rd party. (Thanks to ThoughtWorks for their definition in their most recent Tech Radar.) One way to think of this is ‘Functions as a service / FaaS’ . AWS Lambda is one of the most popular implementations of FaaS at present, but there are others. I’ll be using ‘FaaS’ as a shorthand for this meaning of Serverless throughout the rest of this article.

Page 40: Containers and Microservices for realists · PDF file• Rise of Microservices, ... Firebase), authentication services (Auth0, AWS Cognito), ... is run in stateless compute containers

Traditional Architectures

Page 41: Containers and Microservices for realists · PDF file• Rise of Microservices, ... Firebase), authentication services (Auth0, AWS Cognito), ... is run in stateless compute containers

Serverless Architecture

Page 42: Containers and Microservices for realists · PDF file• Rise of Microservices, ... Firebase), authentication services (Auth0, AWS Cognito), ... is run in stateless compute containers

Difference from PaaS?

Page 43: Containers and Microservices for realists · PDF file• Rise of Microservices, ... Firebase), authentication services (Auth0, AWS Cognito), ... is run in stateless compute containers

• Way to code microservices might not change.

• Still a 12 factor app mindset

• You have to think of scaling in PaaS:

• “How many dynos do I need in Heroku to run this app?”

• “How long does it take to scale from 2->4 servers?”

• Auto scaling on PaaS is great, but this is on a request basis

• Forces developers to write cleaner, more efficient code

Difference from PaaS?

Page 44: Containers and Microservices for realists · PDF file• Rise of Microservices, ... Firebase), authentication services (Auth0, AWS Cognito), ... is run in stateless compute containers

Difference from containers?• FaaS is typically built with containers…

• Once again..Scaling is the core difference.

• FaaS is managed, transparent, fine grained.

• Need to invest time in container platforms to perform scaling actions.

• Prediction: may not be true a year from now…

Page 45: Containers and Microservices for realists · PDF file• Rise of Microservices, ... Firebase), authentication services (Auth0, AWS Cognito), ... is run in stateless compute containers

Serverless Use Cases

• Image Processing

• Data Transformation

• Log Analysis

• Authentication, Licensing

Page 46: Containers and Microservices for realists · PDF file• Rise of Microservices, ... Firebase), authentication services (Auth0, AWS Cognito), ... is run in stateless compute containers

Things we are doing at Oracle

• Container Products for Oracle Public Cloud:

• Oracle Application Container Cloud

• Great for Java/Node/PHP applications

• Oracle Container Service

• Bring your own containers

• Container Management solution

Page 47: Containers and Microservices for realists · PDF file• Rise of Microservices, ... Firebase), authentication services (Auth0, AWS Cognito), ... is run in stateless compute containers

Things we are doing at Oracle

• Container Registry

• Contains pre built Oracle images

• https://container-registry.oracle.com/

• https://github.com/oracle/docker-images

• Dockerfiles for: Database, Java, Weblogic, Coherance

Page 48: Containers and Microservices for realists · PDF file• Rise of Microservices, ... Firebase), authentication services (Auth0, AWS Cognito), ... is run in stateless compute containers

Things we are doing at Oracle

• Free $300 credits to try out all the different services:

• https://cloud.oracle.com/en_US/tryit

Page 49: Containers and Microservices for realists · PDF file• Rise of Microservices, ... Firebase), authentication services (Auth0, AWS Cognito), ... is run in stateless compute containers

Attributions• Images: https://unsplash.com and https://pixabay.com

• State of devops whitepaper: https://puppet.com/resources/infographic/2016-state-of-devops-report-infographic

• Datadog docker adoption: https://www.datadoghq.com/docker-adoption/

• devops.com & ClusterHQ survey: https://clusterhq.com/assets/pdfs/state-of-container-usage-june-2016.pdf

• Oracle Docker Images: https://github.com/oracle/docker-images

• Oracle Container Cloud Service: cloud.oracle.com/container

• Oracle Application Container Service: https://cloud.oracle.com/en_US/application-container-cloud

• Microservices: https://martinfowler.com/articles/microservices.html

• 12 factor apps: https://12factor.net/

• Serverless: https://martinfowler.com/articles/serverless.html

Page 50: Containers and Microservices for realists · PDF file• Rise of Microservices, ... Firebase), authentication services (Auth0, AWS Cognito), ... is run in stateless compute containers
Page 51: Containers and Microservices for realists · PDF file• Rise of Microservices, ... Firebase), authentication services (Auth0, AWS Cognito), ... is run in stateless compute containers

Bonus Content

Page 52: Containers and Microservices for realists · PDF file• Rise of Microservices, ... Firebase), authentication services (Auth0, AWS Cognito), ... is run in stateless compute containers
Page 53: Containers and Microservices for realists · PDF file• Rise of Microservices, ... Firebase), authentication services (Auth0, AWS Cognito), ... is run in stateless compute containers