Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying...

61

Transcript of Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying...

Page 1: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices
Page 2: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

Microservices & Serverless architecture principles applied

Stève Sfartz, API Evangelist @[email protected]

DEVNET-1871

Page 3: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public

Cisco Spark

Questions? Use Cisco Spark to communicate with the speaker after the session

1. Find this session in the Cisco Live Mobile App

2. Click “Join the Discussion”

3. Install Spark or go directly to the space

4. Enter messages/questions in the space

How

cs.co/ciscolivebot#DEVNET-1871

Page 4: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

Why Microservices? … and when!

Applying Twelve Factors

Applying Microservices Design principles

Demos, demos, demos

Microservices & Serverlessarchitecture principles applied

Page 5: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

Why Microservices? … and when!

Page 6: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public

Microservices (2014)Martin Fowler, James Lewis

In short, the microservice architectural style is an approach to developing a single application as a suite of small services, each running in its own process and communicating with lightweight mechanisms, often an HTTP resource API.

These services are built around business capabilities and independently deployable by fully automated deployment machinery.

There is a bare minimum of centralized management of these services, which may be written in different programming languages and use different data storage technologies.

DEVNET-1871 6

Page 7: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public

Monolithic versus Microserviceshttp://martinfowler.com/articles/microservices.html

DEVNET-1871 7

Page 8: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public

the Monolithic style

• An application built as a single unit, 3 main parts

• a client-side user interface ,

• a database

• and a server-side application that handles HTTP requests, execute domain logic, retrieve and update data from the database, and select and populate HTML views to be sent to the browser.

• This server-side application is a monolith

• a single logical executable

• any change requires building and deploying a new version

• Locally built and tested on devs’ machines

• CI/CD pipeline to secure production

8DEVNET-1871

Page 9: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public

scaling the Monolith

• Several instances behind a load balancer

• lack of modularity

DEVNET-1871 9

Load Balancer

Monolith

ClientClient

Client

- Routing traffic complexity

- Very large code base

- Change cycles tied together

- Limited scalability

+ Quickest path to scale

+ High availability

Page 10: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public

making the Monolith more modular

• Specialized instances of a single codebase

• Modular invocation

DEVNET-1871 10

Load BalancerReal time

business logic

ClientClient

Client

MonolithMonolithAuthentication

MonolithBatches

Load Balancer

‘Renovation’ as an alternative to a rewrite

Generally does the trick

BONUS: engage an iterative « API »-fication

Page 11: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public

The End of Monoliths ?

DEVNET-1871 11

http://www.stavros.io/posts/microservices-cargo-cult/

Page 12: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

Applying Twelve Factors

for developers building apps which run as a service

for ops engineers who deploy or manage such apps

Page 13: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 13DEVNET-1871

Twelve Factorshttps://12factor.net/

Page 14: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 14DEVNET-1871

Twelve factors applied to Spark Botshttps://github.com/CiscoDevNet/botkit-template/blob/master/bot.js#L49

Page 15: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

Twelve factors applied to Spark Bots

« One code base to rule them all »

- on your local machine

https://github.com/CiscoDevNet/botkit-template

Page 16: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public

The ‘config file’ versus ‘env variables’ dilemna

• Where to put all not env specific info, nevertheless configurable

• Think defaults for PORTS, HTTP ROUTES, INSTANCE NAME

• Common practice to use a ‘.env’ file to load variables to ENV when your code launches

• Ruby: https://github.com/bkeepers/dotenv

• Node: https://github.com/motdotla/dotenv

• ALWAYS read from ENV and assume env variables precedence

• over-ride defaults, the execution environment always has the last world

• env may be injected by CI/CD tools, your Cloud Platform or Docker Orchestrator

• environment managed by Puppet or Chef

• ‘heroku config’ CLI command, and console environment

• env field in a Kubernetes Pod YAML configuration

16DEVNET-1871

Page 17: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

Twelve factors applied to Spark Bots

« One code base to rule them all »

- on Heroku- on Glitch

https://github.com/CiscoDevNet/botkit-template

Page 18: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public

Twelve Factor Sumpup

• Take time to iterate on your code’s startup to read from environments

• Local dev machines, integration, demo env, production

• When appropriate, dig into each platform specifics

• Enter ops feedbacks as new requirements / add to your backlog

• Logs

• Healthchecks

18DEVNET-1871

Page 19: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

Applying Microservices design principles

Page 20: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public

Monolithic versus Microserviceshttp://martinfowler.com/articles/microservices.html

DEVNET-1871 20

Page 21: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public

Common Characteristics

Componentization via Services

Organized around Business Capabilities

Products not Projects

Smart endpoints and dumb pipes

Decentralized governance

Decentralized data management

Infrastructure automation

Design for failure

Evolutionary design

http://martinfowler.com/articles/microservices.html

DEVNET-1871 21

Page 22: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public

Organized around Business Capabilities

Any organization that

designs a system will

produce a design

whose structure is a

copy of the

organization's

communication

structure.

Melvyn Conway,

1967.

DEVNET-1871 22

Page 23: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public

Organized around Business Capabilities

Microservices to solve Conway’s anti-pattern

Cross-functional teams…. … organised around capabilities

DEVNET-1871 23

Page 24: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

Event bot

Page 25: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public

Componentization via Services

Services as components rather than libraries

Services avoid tight coupling by using explicit remote call mechanisms.

Services are independently deployable and scalable

DEVNET-1871 25

Page 26: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 26DEVNET-1871

Componentization via Serviceshttps://creations.devnetcloud.com/detail?cid=1e4a9f92-deea-11e7-9d2f-aed03b187700

Events API

Bot AdminPublic

catalog

https://devnet-events-api.herokuapp.com/

CiscoDevNet

@sparkbot.io Postman JSON

Voice

Responder

Tropo

Page 27: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public

Smart endpoints and dumb pipes

Be as decoupled and as cohesive as possible

own domain logic,

act more as filters in the classical Unix sense

using simple RESTish protocols and lightweight messaging

Smarts live in the services, not in-between the endpoints

No central tool / bus that includes sophisticated routing, transformations, process, business rules

Pre-requisite : turn the chatty in-process communication of the monolith into coarser-grained network messaging

DEVNET-1871 27

Page 28: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 28DEVNET-1871

Componentization via Services

Think API first = 1 microservice

Treat each API consumer as a new independent channel = multiples consumers

Design Best Practices

deployment

delivery

versioning

contracts

scaling/autoscaling

service discovery

load balancing

routing / adaptive routing

health checking

configuration

circuit breaking

TTL/deadlining

latency tracing

service causal tracing

distributed logging

metrics exposure, collection

Page 29: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

Adaptive Routing

Page 30: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public

When 1 backend becomes latent

DEVNET-1871 30

Page 31: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco PublicDEVNET-1871

At 50+ req/s, all request threads can block in seconds

31

Page 32: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public

NetFlix Hystrix

• Latency and Fault Tolerance library

• designed to isolate points of access to remote systems, services and 3rd party libraries,

• stop cascading failure and enable resilience where failure is inevitable.

• real time monitoring via Dashboard

DEVNET-1871 32

Page 33: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco PublicDEVNET-1871

Hystrix Dashboard

33

Page 34: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public

Healthcheck

• Passive healthcheck

• Automated from analysis of your app responses (ie, check status codes)

• Active healthcheck

• Basically GET / returns a 200 OK

• Provide extra JSON meaning full data

• Used for monitoring, diagnose but also traffic optimization

• Platform dependant: Nginx active healthckech, Amazon LB healthcheck configuration, Kubernetes liveness probes, Envy

• Types of failture: 50x

• Include Maintenance, Recovery states

34DEVNET-1871

Page 35: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

Botkit template Healthcheck

Page 36: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 36DEVNET-1871

Healthcheck

• Always provide an healthcheck

• You cannot assume how your service will be deployed

• Make it configurable

• ON / OFF, credentials

• Provide extra JSON meaning full data

• Include Maintenance, Recovery states

• Documentation

• Start small with 200, think big via adapters to address various platforms

• Nginx active healthckech, Amazon LB healthcheck configuration, Kubernetes liveness probes, Envyo healthckeck

• FAIL FAST (twelve factor)

Best practices

Page 37: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public

Resources

• Amazon healthcheck configuration

• https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-healthchecks.html

• Nginx active healthecks

• https://www.nginx.com/resources/admin-guide/http-health-check/#hc_active

• Kubernetess Livenessprobes

• https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes

• Envoy

• https://istio.io/docs/concepts/what-is-istio/overview.html#envoy

37DEVNET-1871

Page 38: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public

Common Characteristics

Componentization via Services

Organized around Business Capabilities

Products not Projects

Smart endpoints and dumb pipes

Decentralized governance

Decentralized data management

Infrastructure automation

Design for failure

Evolutionary design

http://martinfowler.com/articles/microservices.html

DEVNET-1871 38

Page 39: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

‘Sidecar’ pattern

Page 40: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public

SideCar

• Complement an existing service with extra capabilities via a distinct service rather than in-process

• Ex: SSL endpoint, outgress routing, traffic priorization

• Typically reverse proxy

• Or smart routing

40DEVNET-1871

Page 41: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public

Caddy Web Server

• Production-ready

• Secure by default: HTTPS by default, hardened TLS stack

• Written in go, self-contained

• Single executable with no dependency

• https://caddyserver.com/download

• Multi-platform, container friendly

• Plugin-architecture

41DEVNET-1871

Page 42: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 42DEVNET-1871

Spark Widgets

• Caddyfile

Supports Spark Calls over HTTPS

https://github.com/CiscoDevNet/widget-samples

Page 43: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public

Resources

• Caddy

• https://caddyserver.com/

• Cisco Spark Widget Samples

• https://github.com/CiscoDevNet/widget-samples

• Spark Affinity: scaling Webhooks

• https://github.com/ObjectIsAdvantag/spark-webhook-affinity

43DEVNET-1871

Page 44: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

Programmable API Gateways

Page 45: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco PublicDEVNET-1871

Page 46: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 46DEVNET-1871

Kong

• Opensource API Gateway

• Microservices Management building block

• Set of nginx plugins

• Opensource

• Cluster configuration: persists data to Cassandra or PostgreSQL

https://getkong.org/

Page 47: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

Kong

Page 48: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 48DEVNET-1871

Kong: launching with dockerPostGreSQL backend

docker run -d --name kong-database -p 5432:5432

-e "POSTGRES_USER=kong" -e "POSTGRES_DB=kong" postgres:9.4

docker run --rm --link kong-database:kong-database

-e "KONG_DATABASE=postgres" -e "KONG_PG_HOST=kong-database"

-e "KONG_CASSANDRA_CONTACT_POINTS=kong-database"

kong:latest kong migrations up

Page 49: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 49DEVNET-1871

Kong: launching with dockerReverse proxy

docker run -d --name kong --link kong-database:kong-database

-e "KONG_DATABASE=postgres" -e "KONG_PG_HOST=kong-database"

-e "KONG_CASSANDRA_CONTACT_POINTS=kong-database"

-e "KONG_PROXY_ACCESS_LOG=/dev/stdout"

-e "KONG_ADMIN_ACCESS_LOG=/dev/stdout"

-e "KONG_PROXY_ERROR_LOG=/dev/stderr"

-e "KONG_ADMIN_ERROR_LOG=/dev/stderr"

-p 8000:8000 -p 8001:8001 kong:latest

Page 50: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 50DEVNET-1871

Kong: launching with docker

• Proxy at port :8000

• Administration at :8001

• Expose :8443 and :8444 for SSL support

• Healthcheck at admin root :8001/, :8444/

Reverse proxy

Page 51: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 51DEVNET-1871

Kong: Registering HTTP Endpoint

curl -i -X POST --url http://localhost:8001/apis/

--data 'name=minispark'

--data 'uris=/minispark'

--data 'upstream_url=https://mini-spark.herokuapp.com/'

Via admin API

Page 52: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 52DEVNET-1871

Kong: Rate Limitation

curl -X POST http://localhost:8001/apis/minispark/plugins

--data "name=rate-limiting"

--data "config.minute=5"

--data "config.limit_by=credential"

https://getkong.org/plugins/rate-limiting/

Page 53: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public

Resources

• Kong

• https://getkong.org

• Tyk

• https://tyk.io

• Envoy

• https://www.envoyproxy.io

• Ambassador

• https://www.getambassador.io

53DEVNET-1871

Page 54: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

Wrapup

Page 55: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 55DEVNET-1871

Wrapup

• Make your code easy to run and scale

• Embrace environment variables and configuration best practices

• Docker-ready, Kubernetes-ready

• Leverage the infrastructure, don’t ignore it !!!

• Get familiar with Load Balancers, Reverse Proxies, API Gateways

• Use for local testing, demonstration environments

• Expose healthchecks

Applying Microservices Principles as an Application Developer

Page 56: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 56DEVNET-1871

Wrapup: other considerations

• Solid communications

• Fault tolerant pipes

• Gateways and Service discovery

• Committed teams

• Devops culture

• Code/Test/Deploy/Support, 24/7

• Automation, automation, automation

• Ownership

• Organisation aligned with the overall strategy

• Operational insights (monitoring, logging infrastructure, real time analysis)

Lessons learnt from Microservices journeys

Page 57: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public

Cisco Spark

Questions? Use Cisco Spark to communicate with the speaker after the session

1. Find this session in the Cisco Live Mobile App

2. Click “Join the Discussion”

3. Install Spark or go directly to the space

4. Enter messages/questions in the space

How

cs.co/ciscolivebot#DEVNET-1871

Page 58: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public

• Please complete your Online Session Evaluations after each session

• Complete 4 Session Evaluations & the Overall Conference Evaluation (available from Thursday) to receive your Cisco Live T-shirt

• All surveys can be completed via the Cisco Live Mobile App or the Communication Stations

Don’t forget: Cisco Live sessions will be available for viewing on-demand after the event at www.ciscolive.com/global/on-demand-library/.

Complete Your Online Session Evaluation

Page 59: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public

Continue Your Education

• Demos in the Cisco campus

• Walk-in Self-Paced Labs

• Tech Circle

• Meet the Engineer 1:1 meetings

• Related sessions

DEVNET-1871 59

Page 60: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices

Thank you

Page 61: Microservices & Serverless - clnv.s3.amazonaws.com · Why Microservices? … and when! Applying Twelve Factors Applying Microservices Design principles Demos, demos, demos Microservices