Slide 1

Slide 1 text

Leading in IT Education .co.il www.

Slide 2

Slide 2 text

Leading in IT Education .co.il www. Agenda ○ Intro to microservices ○ Architecture: Monoliths vs. Microservices ○ MSA best practices

Slide 3

Slide 3 text

Leading in IT Education .co.il www. MicroServices Loosely coupled service oriented architecture with bounded contexts not updated at the same time slideshare.net/adriancockcroft/dockercon-state-of-the-art-in-microservices minimal knowledge of own environment

Slide 4

Slide 4 text

Leading in IT Education .co.il www. why microservices ● smaller code easier to change/understand ● faster start time / speedier deployments ● decoupling of concerns [SOLID] ● independent scaling ● better fit with infrastructure (mem/cpu) ● scaling development teams ● fault isolation ● flexibility in choosing a technology stack ○ ↵

Slide 5

Slide 5 text

Leading in IT Education .co.il www. why NOT microservices ● developing distributed system complexity ● implement inter-process communication ● transactions are more difficult to track ● integration automated tests a challenge ● operational complexity - multiple moving parts ● coordination between teams about dependencies

Slide 6

Slide 6 text

Leading in IT Education .co.il www. architecture of SaaS applications

Slide 7

Slide 7 text

Leading in IT Education .co.il www. aws.amazon.com/architecture

Slide 8

Slide 8 text

Leading in IT Education .co.il www. monolithic vs. micro yobriefca.se/blog/2013/04/29/micro-service-architecture/

Slide 9

Slide 9 text

Leading in IT Education .co.il www. MySQL PostgreSQL MongoDB Oracle MS-SQL “nosql” database async worker RabbitMQ ActiveMQ Kafka Memcached Redis APC Ruby on Rails Django Spring ASP.NET PHP monolithic application presentation business logic data access request / response relational database cache queue scheduler microservices.io/patterns/monolithic.html

Slide 10

Slide 10 text

Leading in IT Education .co.il www. Components of Ruby on Rails $ rails new myapp create config.ru create Gemfile create app/assets/javascripts/application.js create app/assets/stylesheets/application.css create app/controllers/application_controller.rb create app/views/layouts/application.html.erb create config/routes.rb create config/application.rb create config/environment.rb create config/secrets.yml create config/initializers/assets.rb create config/initializers/backtrace_silencers.rb create config/initializers/cookies_serializer.rb create config/initializers/filter_parameter_logging.rb create config/initializers/inflections.rb create config/initializers/mime_types.rb create config/initializers/session_store.rb create config/initializers/wrap_parameters.rb create config/locales/en.yml create config/boot.rb create config/database.yml create db/seeds.rb create log create public/404.html create public/422.html create public/500.html create public/robots.txt create tmp/cache create tmp/cache/assets create vendor/assets/javascripts create vendor/assets/stylesheets

Slide 11

Slide 11 text

Leading in IT Education .co.il www. monitoring configuration router layout data access queue cache scheduler micro services infrastructure services authentication authorization form handling file uploads web scraping indexing searching application services e-mail pdf generation payments workflow engine pagination load balancer

Slide 12

Slide 12 text

Leading in IT Education .co.il www. microservice types ○ sync, in-path request / response ○ async “enrich” workers ○ databases ○ event handlers ○ encapsulate private database ○ sharing a database

Slide 13

Slide 13 text

Leading in IT Education .co.il www. Service Discovery service

Slide 14

Slide 14 text

Leading in IT Education .co.il www. Service Discovery Allows automatic detection of devices and services Composed usually of two parts: ● service registration ● service lookup / discovery

Slide 15

Slide 15 text

Leading in IT Education .co.il www. Service Registration The process of a service registering its location in a central registry: ● Authentication credentials ● Protocols ● Versions numbers

Slide 16

Slide 16 text

Leading in IT Education .co.il www. Service Discovery The process of a client application querying the central registry to learn of the location of services

Slide 17

Slide 17 text

Leading in IT Education .co.il www. Service Discovery Zookeeper • Doozer • Etcd Eureka • Serf • DNS • SkyDNS • Consul Redis • Database (don’t do this) jasonwilder.com/blog/2014/02/04/service-discovery-in-the-cloud/

Slide 18

Slide 18 text

Leading in IT Education .co.il www. communication in a microservices world

Slide 19

Slide 19 text

Leading in IT Education .co.il www. REST API ● HTTP Transport ● HTTP Verbs ● Resources ● Versioning

Slide 20

Slide 20 text

Leading in IT Education .co.il www. request types ● user request endpoints ○ with layout ○ api only [mobile, etc…] ● inner-service ● webhook callbacks

Slide 21

Slide 21 text

Leading in IT Education .co.il www. ruby rack web application run Proc.new { |env| [ 200, {'Content-Type' => 'text/html'}, [ "Hello world!" ] ] } gem install rack && rackup app.rb

Slide 22

Slide 22 text

Leading in IT Education .co.il www. go web application package main import ( "fmt" "net/http" ) func handler(w http.ResponseWriter, r *http.Request) { fmt.Fprint(w, "Hello world!") } func main() { http.HandleFunc("/", handler) http.ListenAndServe(":8080", nil) }

Slide 23

Slide 23 text

Leading in IT Education .co.il www. composing service

Slide 24

Slide 24 text

Leading in IT Education .co.il www. request a web page from google/amazon/facebook how many services were involved in its creation?

Slide 25

Slide 25 text

Leading in IT Education .co.il www. composing ○ ajax ○ iframes ○ server side includes (Apache/nginx) ○ edge side includes (Akamai/Varnish) what about json api includes? dejanglozic.com/2014/10/20/micro-services-and-page-composition-problem/

Slide 26

Slide 26 text

Leading in IT Education .co.il www. compoxure medium.com/@clifcunn/nodeconf-eu-29dd3ed500ec github.com/tes/compoxure

Slide 27

Slide 27 text

Leading in IT Education .co.il www. go ssi - ssi.go func ssi(url string) template.HTML { resp, err := http.Get(url) defer resp.Body.Close() body, err := ioutil.ReadAll(resp.Body) return template.HTML(body) } func ssiHandler(w http.ResponseWriter, r *http.Request) { funcMap := template.FuncMap { "ssi": ssi, } tmpl, err := template.New("root").Funcs(funcMap).ParseGlob("*.html") err = tmpl.ExecuteTemplate(w, "combiner.html", "") }

Slide 28

Slide 28 text

Leading in IT Education .co.il www. go ssi - combiner.html
{{ ssi "http://plus.google.com" }}
{{ ssi "http://www.facebook.com" }}

Slide 29

Slide 29 text

Leading in IT Education .co.il www. API Gateway service microservices.io/patterns/apigateway.html

Slide 30

Slide 30 text

Leading in IT Education .co.il www. API Gateway techblog.netflix.com/2013/01/optimizing-netflix-api.html

Slide 31

Slide 31 text

Leading in IT Education .co.il www. API Gateway techblog.netflix.com/2013/01/optimizing-netflix-api.html

Slide 32

Slide 32 text

Leading in IT Education .co.il www. API Gateway techblog.netflix.com/2013/06/announcing-zuul-edge-service-in-cloud.html

Slide 33

Slide 33 text

Leading in IT Education .co.il www. API Gateway techblog.netflix.com/2013/06/announcing-zuul-edge-service-in-cloud.html

Slide 34

Slide 34 text

Leading in IT Education .co.il www. Bestter Practices for microservices

Slide 35

Slide 35 text

Leading in IT Education .co.il www. SOLID principles ○ Single Responsibility - single reason to change ○ Liskov Substitution - single API, polyglot implementation ○ Interface Segregation - bounded context, minimum knowledge ○ Dependency Inversion - api gateway mattstine.com/2014/06/30/microservices-are-solid

Slide 36

Slide 36 text

Leading in IT Education .co.il www. MSA Patterns ● Circuit breakers ● Dynamic (external) configuration ● Automagic service discovery ● Data Enrichment

Slide 37

Slide 37 text

Leading in IT Education .co.il www. Micro Service Skeleton ○ communication protocol [REST ProtoBuf MQ] ○ monitoring / metrics ○ logging ○ change management [versioning] ○ deployment / rollback

Slide 38

Slide 38 text

Leading in IT Education .co.il www. Micro Service Infrastructure ○ server - service fit ○ multi-tenancy ○ promise registry ○ services - ○ queue ○ builder / bakery ○ auto scaling

Slide 39

Slide 39 text

Leading in IT Education .co.il www. “If you can’t feed a team with two pizzas, it’s too large. That limits a task force to five to seven people, depending on their appetites” - Jeff Bezos medium.com/@benorama/the-evolution-of-software-architecture-bd6ea674c477

Slide 40

Slide 40 text

Leading in IT Education .co.il www. references ○ martinfowler.com/articles/microservices.html ○ infoq.com/articles/microservices-intro ○ slideshare.net/luksow/microservices-workshopiteratorswarsjawa2014 ○ blog.xebia.com/2014/07/04/create-the-smallest-possible-docker-container/ ○ highscalability.com/blog/2014/4/8/microservices-not-a-free-lunch.html ○ blog.heroku.com/archives/2013/12/3/end_monolithic_app ○ youtube.com/watch?v=WwrCGP96-P8

Slide 41

Slide 41 text

Leading in IT Education .co.il www. Thank you! www.devops.co.il We invite you to join Operations Israel Facebook group on on.fb.me/Ops-IL we are hiring at [email protected]

Slide 42

Slide 42 text

Leading in IT Education .co.il www.

Slide 43

Slide 43 text

Leading in IT Education .co.il www. http://www.thoughtworks.com/insights/blog/microservices-nutshell http://blog.dataloop.io/2014/12/15/monitoring-for-micro-services/ https://blog.docker.com/2014/12/dockercon-europe-keynote-state-of-the-art-in-microservices-by-adrian-cockcroft-battery-ventures/ http://thenewstack.io/dockercon-europe-adrian-cockcroft-on-the-state-of-microservices/ http://assets.thoughtworks.com/assets/technology-radar-july-2014-en.pdf http://blog.dataloop.io/2014/04/29/devops-exchange-meetup-april-14-microservices-for-devops/ http://www.slideshare.net/jpetazzo/containers-docker-and-microservices-the-terrific-trio http://tech.gilt.com/post/102628539834/making-architecture-work-in-microservice http://plainoldobjects.com/2014/11/16/deploying-spring-boot-based-microservices-with-docker/ http://java.dzone.com/articles/getting-granular-microservices?mz=62447-cloud http://techblog.realestate.com.au/a-microservices-implementation-retrospective/ http://martinfowler.com/bliki/MicroservicePrerequisites.html http://dius.com.au/2014/05/19/simplifying-micro-service-testing-with-pacts/ http://www.boundary.com/blog/2014/08/microservices-conways-law/ http://thenewstack.io/reactive-frameworks-microservices-docker-and-other-necessities-for-scalable-cloud-native-applications/ http://adetante.github.io/articles/service-discovery-with-docker-1/ http://adetante.github.io/articles/service-discovery-with-docker-2/ http://www.codingthearchitecture.com/2014/07/06/distributed_big_balls_of_mud.html http://martinfowler.com/articles/distributed-objects-microservices.html http://www.slideshare.net/lynxmanuk/microservices-and-the-cloud-devops-cardiff-meetup http://blog.osgi.org/2014/07/the-big-ball-of-mud.html http://contino.co.uk/use-docker-continuously-deliver-microservices-part-1/ http://blog.carbonfive.com/2014/05/29/an-incremental-migration-from-rails-monolithic-to-microservices/?utm_source=rubyweekly&utm_medium=email http://www.brunton-spall.co.uk/post/2014/05/21/what-is-a-microservice-and-why-does-it-matter/ http://blog.carbonfive.com/2014/04/28/micromessaging-connecting-heroku-microservices-wredis-and-rabbitmq/ http://highscalability.com/blog/2014/4/8/microservices-not-a-free-lunch.html http://martinfowler.com/articles/microservices.html http://www.slideshare.net/michaelneale/microservices-and-functional-programming

Slide 44

Slide 44 text

Leading in IT Education .co.il www. http://blog.codescrum.com/2014/12/16/Microservices_with_RabbitMQ_and_Docker/ http://microservices.io/ http://www.toolsjournal.com/integrations-articles/item/3689-interview-wavemaker-ceo-on-api-growth-and-microservices-architecture http://searchsoa.techtarget.com/feature/Microservices-is-more-than-a-buzzword http://www.thoughtworks.com/insights/blog/top-technical-content-insights-2014 https://www.voxxed.com/blog/2014/12/exploring-microservices-in-the-enterprise/ http://blog.gopheracademy.com/advent-2014/testing-microservices-in-go/ http://www.thoughtworks.com/insights/blog/microservices-nutshell http://www.infoq.com/news/2014/11/gotober-fowler-microservices http://www.oreilly.com/pub/e/3261 http://www.activestate.com/blog/2014/12/merry-microservices http://java.dzone.com/articles/can-microservices-architecture http://www.slideshare.net/stonse/microservices-at-netflix http://www.slideshare.net/ThoughtWorks/sam-newman-deployingandtestingmicroservices?related=1 http://blogs.jsfcentral.com/JSFNewscast/entry/enterprise_java_newscast_episode_23 http://searchsoa.techtarget.com/answer/Microservices-architecture-101-What-the-heck-is-it http://www.codingthearchitecture.com/2014/07/06/distributed_big_balls_of_mud.html http://www.infoq.com/news/2014/12/netflix-prana http://www.slideshare.net/aahoogendoorn/20141222-growing-a-microservices-landscape-with-smart-use-cases http://searchsoa.techtarget.com/feature/Microservices-is-more-than-a-buzzword http://www.javaadvent.com/2014/12/doing-microservices-with-micro-infra.html#more https://developers.soundcloud.com/blog/building-products-at-soundcloud-part-3-microservices-in-scala-and-finagle http://anders.janmyr.com/2014/12/lambda-javascript-micro-services-on-aws.html?m=1 http://linux.sys-con.com/node/3268704 http://blog.gopheracademy.com/advent-2014/atlas/ http://michaelfeathers.silvrback.com/microservices-until-macro-complexity http://www.toolsjournal.com/integrations-articles/item/3689-interview-wavemaker-ceo-on-api-growth-and-microservices-architecture http://marmelab.com/blog/2014/12/19/microservice-administration-with-ng-admin.html http://java.dzone.com/articles/microservices-and-platform http://searchsoa.techtarget.com/video/Moving-away-from-ESBs-to-microservices http://www.infoq.com/news/2014/12/monoliths-microservices https://github.com/4finance/micro-infra-spring/blob/master/CHANGELOG.md#0721 https://developer.ibm.com/wasdev/blog/2014/08/27/microservices-liberty-netflixoss/ http://www.activestate.com/blog/2014/12/microservices-and-paas-part-vi