recipes for a successful production cloudfoundry deployment - cf summit 2014

31
© 2014

Upload: vinicius-carvalho

Post on 31-May-2015

370 views

Category:

Technology


1 download

DESCRIPTION

How to be successful on a PCF deployment into production. This deck shows lessons learned while pushing to production a revamped platform on a large media company. It shows a few things I've learned as chief architect while deploying apps using the microservices strategy

TRANSCRIPT

Page 1: Recipes for a successful production cloudfoundry deployment - CF Summit 2014

© 2014!

Page 2: Recipes for a successful production cloudfoundry deployment - CF Summit 2014

RECIPES FOR A SUCCESSFUL CLOUDFOUNDRY PRODUCTION DEPLOYMENT!

Vinicius  Carvalho  –  Pivotal  @vccarvalho  

Page 3: Recipes for a successful production cloudfoundry deployment - CF Summit 2014

I  am  a  developer  

Page 4: Recipes for a successful production cloudfoundry deployment - CF Summit 2014

CF  power  up  

Page 5: Recipes for a successful production cloudfoundry deployment - CF Summit 2014

Challenges  •  Large  distributed  Systems  :  Failure  becomes  the  norm  not  the  excepAon  

•  Enhance  developer  experience  of  your  API  •  Enforce  security  and  access  control  of  endpoints  •  Service  discovery  •  Avoid  duplicaAon  

Page 6: Recipes for a successful production cloudfoundry deployment - CF Summit 2014

Give  this  to  your    developers  

Page 7: Recipes for a successful production cloudfoundry deployment - CF Summit 2014

They  will  soon    as  for  this  

Page 8: Recipes for a successful production cloudfoundry deployment - CF Summit 2014

Powered  by  Swagger  

Page 9: Recipes for a successful production cloudfoundry deployment - CF Summit 2014

Talking  about  services  

Busin

ess  V

alue

  Reusability  Biz  

Services  Biz  

Services  Biz  

Services  

Core  Services  

Core  Services  

Core  Services  

Core  Services  

Data  Services  

Data  Services  

Data  Services  

Data  Services  

Data  Services  

Data  Services  

Apps   API  

Page 10: Recipes for a successful production cloudfoundry deployment - CF Summit 2014

Core  Biz  Services  

Who  the  hell  are  those?  

Page 11: Recipes for a successful production cloudfoundry deployment - CF Summit 2014

Service  Registry  •  Stores  service  informaAon  – API  endpoints  – Security  metadata  (Access  Control  Lists,  Roles)  – Resource  relaAonships  – Quality  of  service  – Extended  Metadata  

Page 12: Recipes for a successful production cloudfoundry deployment - CF Summit 2014

Service  Registry  Services  

Instances  

API  

Endpoints  

Security  

UI  Metadata  

QOS  

Billing  

/api/apidocs!

GET /users!PUT /{id}!

GET /users! - ClientId: myapp! - roles: [USER,MANAGER]

!!

User : {! SSN: {! type: “string”,! selectable: false,! editable: false! }!}!

/search : {! limit : {! value : 300,! time: 3600,! unit: “seconds”! } !}!

/search : {! rate : {! currency : “USD”,! value : 0.10,! meterType: “UNIT”,! meterValue: 1000! }!}!

Page 13: Recipes for a successful production cloudfoundry deployment - CF Summit 2014

Cloud  Controller  

DEA   Registry  

GET  /v2/events  

GET  /api/apidocs  

push  app  +  app  MD  

Router  

Page 14: Recipes for a successful production cloudfoundry deployment - CF Summit 2014

UAA  

     NeUy  Pipeline  

GET /users!Authentication: Bearer <token>!

Service  Proxy  

User  Service  

Registry  

Obtain  metadata  

Validate  CredenAals   QoS   Billing  

Page 15: Recipes for a successful production cloudfoundry deployment - CF Summit 2014

UAA  

     NeUy  Pipeline  

GET /users!Authentication: Bearer <token>!

Service  Proxy  

User  Service  

Registry  

Data  Filter  

{!“firstname” : “joe”,!“lastname” : “doe”,!“comp” : 135,000.00!}!

Obtain  metadata  

Validate  CredenAals   QoS   Billing  

Page 16: Recipes for a successful production cloudfoundry deployment - CF Summit 2014

UAA  

     NeUy  Pipeline  

GET /users!Authentication: Bearer <token>!

Service  Proxy  

User  Service  

Outbound    handler  

Registry  

Data  Filter  

Obtain  metadata  

Validate  CredenAals   QoS   Billing  

Outbound    handler  

{!“firstname” : “joe”,!“lastname” : “doe”,!}!

{!“firstname” : “joe”,!“lastname” : “doe”,!“comp” : 135,000.00!}!

Page 17: Recipes for a successful production cloudfoundry deployment - CF Summit 2014

Security    •  Don’t  use  LDAP  for  authorizaAon  •  Corporate  LDAPs  can  be  very  polluted,  move  away  from  role  

mapping  and  don’t  add  more  noise  to  them  

UAA  

LDAP  

AuthenAcate  

{! "jti":"4657c1a8-b2d0-4304-b1fe-7bdc203d944f",! "aud":["openid","cloud_controller"],! "scope":["read"],! "email":"[email protected]",! "exp":138943173,! "user_id":"41750ae1-b2d0-4304-b1fe-7bdc24256387",! "user_name":"marissa",! "client_id":"vmc"!}!

ACLS  

Page 18: Recipes for a successful production cloudfoundry deployment - CF Summit 2014

Biz  Services  

Data  Services  

Core  Services  

Make  sure  your  rest  client  propagates  the  token  for  the  next  service  

Page 19: Recipes for a successful production cloudfoundry deployment - CF Summit 2014

The  Dark  side  of  microservices  architectures  

•  MulAple  remote  calls  •  EnAty  relaAonships  •  Great  arAcle  by  Chris  Richardson  :  hUp://

www.infoq.com/arAcles/microservices-­‐intro  

Page 20: Recipes for a successful production cloudfoundry deployment - CF Summit 2014

Biz  Services  

Biz  Services  

Data  Services  

Data  Services  

Data  Services  

Data  Services  

Data  Services  

Data  Services  

Apps  

Core  Services  

Core  Services  

Core  Services  

Core  Services  

Respon

se  Tim

e  

Page 21: Recipes for a successful production cloudfoundry deployment - CF Summit 2014

Biz  Services  

Biz  Services  

Data  Services  

Data  Services  

Data  Services  

Data  Services  

Data  Services  

Data  Services  

Apps  

Core  Services  

Core  Services  

Core  Services  

Core  Services  

Respon

se  Tim

e  

Page 22: Recipes for a successful production cloudfoundry deployment - CF Summit 2014

Biz  Services  

Biz  Services  

Data  Services  

Data  Services  

Data  Services  

Data  Services  

Data  Services  

Data  Services  

Apps  

Core  Services  

Core  Services  

Core  Services  

Core  Services  

Respon

se  Tim

e  

Page 23: Recipes for a successful production cloudfoundry deployment - CF Summit 2014

Biz  Services  

Biz  Services  

Data  Services  

Data  Services  

Data  Services  

Data  Services  

Data  Services  

Data  Services  

Apps  

Core  Services  

Core  Services  

Core  Services  

Core  Services  

Respon

se  Tim

e  

Page 24: Recipes for a successful production cloudfoundry deployment - CF Summit 2014
Page 25: Recipes for a successful production cloudfoundry deployment - CF Summit 2014

TX  Manager  

Hibernate    Session  

TradiAonal  web  applicaAon  

Controller  

Service   Repo  

EnAty   EnAty  

Cascading operations are managed by the session factory

Page 26: Recipes for a successful production cloudfoundry deployment - CF Summit 2014

Ripple  effect  of  enAty  relaAonship  

Product  

Inventory  

Orders   Users  

Page 27: Recipes for a successful production cloudfoundry deployment - CF Summit 2014

Event  driven  data  services  

Inventory   Orders   Users  

{enAty:  Product,  Event:  UPDATE}  

Product  

Page 28: Recipes for a successful production cloudfoundry deployment - CF Summit 2014

HTTP  events  

•  High  efficient  server  sent  events  using  non  blocking  containers  (JeUy  9,  Tomcat  8,  Spray,  Play,  NeUy)  

•  Use  webhooks  when  comet/conAnuaAons  are  not  possible  

•  Pubsubhubbub?  

Product  

GET  /{id}  PUT  /{Id}  POST  /    GET  /events  à  SSE  POST  /hook/  à  callback  url  

Page 29: Recipes for a successful production cloudfoundry deployment - CF Summit 2014

Polyglot  persistence  

Page 30: Recipes for a successful production cloudfoundry deployment - CF Summit 2014

Polyglot  persistence  

Data    Service  

{! "posts": [{! "id": "1",! "title": “The four levels of HA on pivotal CF",! "links": [{! ”author": {! "href": "http://blog.gopivotal.com/author/cdavis",! "id":”ffd5b644-b220-4f7c-efad-2dfee6768bb9” ! }]!}! }]!}!

EnAty    RelaAonship  

Data    Service  

Data    Service  

Data    Service  

Data    Service  

Page 31: Recipes for a successful production cloudfoundry deployment - CF Summit 2014

Thank  you!