Cloud anti-patterns

35
CLOUD ANTI- PATTERNS DevOpsDays Detroit November 2015

Transcript of Cloud anti-patterns

Page 1: Cloud anti-patterns

CLOUD ANTI-PATTERNSDevOpsDays DetroitNovember 2015

Page 2: Cloud anti-patterns

@cloudfoundryart

whoami Mallika Iyer Cloud Foundry Specialist @ PivotalTwitter @cloudfoundryartLinkedIn in/imallika

Page 3: Cloud anti-patterns

Certified TRX trainer | Fitness junkie | German Shepherd Fanatic

@cloudfoundryart

Page 4: Cloud anti-patterns

@cloudfoundryart

Page 5: Cloud anti-patterns

@cloudfoundryart

Agenda• Cloud Anti-Patterns• #1 Ignoring the Sweet Spot• #2 Risk Mitigation v/s Innovation• #3 The Monolithic Microservice• #4 The Logic Leak • #5 The 3 musketeers of cloud-native apps• #6 Boil tea, not the ocean• #7 The micro-service push & shove• #8 Build Pipelines are your BFFs• #9 Siloed Search

• Summary

Page 6: Cloud anti-patterns

@cloudfoundryart

Before we begin…• Let’s define things!

Page 7: Cloud anti-patterns

@cloudfoundryart

MicroservicesMicroservices is a software architecture design pattern, in which complex applications are composed of small, independent processes communicating with each other using language-agnostic APIs. These services are small, autonomous, highly decoupled, work together and focus on doing a small task.

Page 8: Cloud anti-patterns

@cloudfoundryart

ContainersA container is an isolated and lightweight environment that can run a service or application without reliance on a separate operating system

eg: Docker, Warden, Garden, Rocket…

Page 9: Cloud anti-patterns

@cloudfoundryart

Continuous IntegrationThe practice of merging all developer working copies to a shared mainline several times a day

Page 10: Cloud anti-patterns

@cloudfoundryart

Continuous DeliveryAn approach where teams produce valuable software in short cycles and release the software reliably, predictably and at times, automatically

eg: Concourse,

Jenkins, Bamboo…

Page 11: Cloud anti-patterns

Cloud Anti-Patterns

Page 12: Cloud anti-patterns

@cloudfoundryart

#1 Finding the sweet spot

Sweet spot

cnp

CNP= Cloud Native Platform as a Service like Cloud Foundry

Page 13: Cloud anti-patterns

@cloudfoundryart

#1 Ignoring the sweet spot

Page 14: Cloud anti-patterns

@cloudfoundryart

#1 Ignoring the sweet spot

If I close my eyes it doesn’t exist…

cnp

CNP= Cloud Native Platform as a Service like Cloud Foundry

Page 15: Cloud anti-patterns

@cloudfoundryart

#2 Risk Mitigation v/s Innovation

• Problem• Need to innovate• Want to release cool features to production NOW• Ops simply cannot support this because of uptime,

HA, DR and other concerns

• Result• Everyone is unhappy • Business is angry• Everyone blames IT-Ops

• It’s not really fair...

Page 16: Cloud anti-patterns

@cloudfoundryart

Hai ya! New cool features

tomorrow!!

No more github for

you…

Code Ninjas/Developers

Special Ops/Operations

Page 17: Cloud anti-patterns

@cloudfoundryart

#2 Risk Mitigation v/s Innovation

• Solution• You don’t have to choose!• Select the right platform• Something like Cloud Foundry…• Self-healing

• Application distribution across Availability Zones• Application resurrection• Self-monitoring and resurrection • VM recreation

• Inherently HA• Visibility into all development activity

Page 18: Cloud anti-patterns

@cloudfoundryart

#3 The monolithic microservice

• Temptation:• Grouping similar microservices in the same

container

• Problem:• Unable to scale• Unable to deploy changes • The monolithic creep

• Solution:• ONE Micro Service Per container

Page 19: Cloud anti-patterns

@cloudfoundryart

#4 The Logic LeakTemptation:

Premature decomposition of microservices

• Problem:• Company ‘Amazing-

Stuff!!!’ has a product called ‘Awesome’

• They plan to create a new offering called ‘Super-Awesome’

• Similarities between the 2 products cause them to split microservices and consume them across both products

• ‘Super-Awesome’ really KICKS off…takes a life of its own

• Causing the developers to rewrite the microservices for the new product

Page 20: Cloud anti-patterns

@cloudfoundryart

This micro service smellsof too many beers and sweat…

Page 21: Cloud anti-patterns

@cloudfoundryart

#4 The Logic Leak• Lesson Learned:

• DON’T BE IN A HURRY to GO MICRO – Let it be gradual!

Page 22: Cloud anti-patterns

@cloudfoundryart

#5 Ignoring the 3 Musketeers

APIsService Registry& Discovery

FaultTolerance

Page 23: Cloud anti-patterns

@cloudfoundryart

#5 The 3 Musketeers : APIs

Problem• 100+ microservices

need to talk to each other

• Many are changing simultaneously

• And they are in about 5 different languages

Solution• Use language-

independent APIs and API interfaces like swagger.io

• Honor the contract between microservices

• Interactively document the API and integrate it with your project tracker

Page 24: Cloud anti-patterns

@cloudfoundryart

#5 The 3 Musketeers : Service Discovery & Registry

Problem• 100+ microservices are

now talking to each other…

• Every time a new microservice is added, all the others must manually be informed of its presence

Solution• Use a service

discovery and registry tool like Eureka (part of Spring Cloud Services)

• Automate Service Discovery and Registration

• No errors at scale

Page 25: Cloud anti-patterns

@cloudfoundryart

#5 The 3 Musketeers : Fault Tolerance

Problem• A couple of internal

services that feed your application fail for some reason

• The failure has now propagated to the API

• Your customers now experience a disruption in service causing $$$$$$ loss in revenue

Solution• Use a circuit breaker like

Hystrix (part of Spring Cloud Services)

• Isolate the point of origin of the failure

• Contain the error and prevent cascading failure

• Graceful degradation of service while we work furiously behind the scenes to fix it

Page 26: Cloud anti-patterns

@cloudfoundryart

#6 Boil Tea, Not the Ocean • Problem:• The temptation to lift and shift a monolith• Trying to rewrite the entire application• Too much, too fast, too soon

• Challenges:• Unrealistic• Might not even be possible due to IaaS restrictions• Moving a problem from a place you (kind of) understand

to a place you absolutely don’t

• Result:• The Cloud Native Initiative lives on PowerPoint for

eternity

Page 27: Cloud anti-patterns

@cloudfoundryart

#6 Boil Tea, Not the Ocean • Solution:• Identify a function that can be rebuilt

• Something that would benefit from innovation• Something that is hard to modify • Something new

• With minimum impact on the rest of the monolith• Clearly outline the technical debt associated with

that function• Rewrite following best practices for microservices

• Start really…really small• Or really…really new

Page 28: Cloud anti-patterns

@cloudfoundryart

#7 The microservice push & shove

Page 29: Cloud anti-patterns

@cloudfoundryart

#7 The microservice push & shove• Problem:• In a distributed application architecture, how do you

figure out where to look?

• Solution:• It doesn’t have to be that way…• Logging is your friend… • Pivotal Ops Metrics• New Relic, App Dynamics, Sumo Logic, ELK, Splunk…

and so many more• Dynamic Tracing is your friend…• Explore Zipkin

• Application Performance Monitoring tools…• New Relic, Drip Stat…

Page 30: Cloud anti-patterns

@cloudfoundryart

#8 Build Pipelines are your BFFs

KEEP CALM AND HUG YOUR

BUILD PIPELINES

Page 31: Cloud anti-patterns

@cloudfoundryart

#9 Siloed Search • Problem:• Users cannot perform unified search

across data silos

• Search data is stale

Page 32: Cloud anti-patterns

@cloudfoundryart

#9 Cloud-Native Federated Search

Solution:

• Create an Enterprise-Wide Data Bus with RabbitMQ or Kafka • Multiple microservices can asynchronously

publish interesting data points

• Search Event Listeners will listen to these events and update the search indices in real-time

• Basically going from a data push model to Real-time Data Pull Model

Page 33: Cloud anti-patterns

@cloudfoundryart

Summary• Don’t ignore the sweet spot – A Cloud Native Platform

as a Service like Cloud Foundry is your best friend

• You don’t have to choose between Risk Mitigation and Innovation – A Cloud Native Platform is your ally

• The Monolithic Micro service – don’t be THAT guy

• Be wary of the micro service smells – Don’t Repeat Yourself

• The 3 Musketeers are your best friends: APIs(swagger.io), Service Registry & Discovery (Eureka – Spring Cloud Services), Fault Tolerance (Hystrix-Spring Cloud Services)

Page 34: Cloud anti-patterns

@cloudfoundryart

Summary• Boil tea, not the ocean – Start small, start new

• Microservices need not be murder mysteries – Logging and Tracing are your BFFs

• Automation is your friend – Keep calm and hug your build pipelines across environments

• Siloed Search will ruin your customer experience – Search should NEVER been an afterthought

Page 35: Cloud anti-patterns

Thank you!Mallika Iyer @ PivotalTwitter @cloudfoundryartLinkedIn in/imallika