SlideShare une entreprise Scribd logo
1  sur  42
Building Micro-Services with Scala 
Lior Shapsa, Yardena Meymann 
September 22, 2014 
© 2014 VMware Inc. All rights reserved.
Traditional Architecture
Traditional Architecture
Problems with Monoliths 
• Size 
• Integration (Conway’s law) 
• Modules Change at Different Rates 
• Dependencies Collisions 
• Scalability requirements of modules 
FEAR OF CHANGE 
FEAR OF INNOVATION
Micro Services
Thought Leaders 
Netflix, Amazon, 
LinkedIn, Google, 
ThoughtWorks, Gilt, 
… 
Fred George 
Martin Fowler 
Kit Colbert 
Ben Fathi 
Stefan Tilkov 
VMware
What are micro-services? 
A set of narrowly focused,
What are micro-services? 
A set of narrowly focused, 
independently deployable services,
What are micro-services? 
A set of narrowly focused, 
independently deployable services, 
talking via uniform interfaces
What are micro-services? 
A set of narrowly focused, 
independently deployable services, 
talking via uniform interfaces
Micro-services 
• Each running in its own process 
• Communicating with lightweight 
mechanisms, often an HTTP 
resource API 
• Built around business capabilities 
• Independently deployable 
– fully automated deployment 
• May be in a different programming language and use 
different data storage technologies.
Micro-services 
DEPLOYING A CHANGE IS LOW RISK
#NonBlocking
Threaded vs. Evented Servers 
• Monolithic 
– Most modules communicate in-process 
• Micro-services 
– communicate remotely, often over the network 
– need to support cheap, lightweight remote communication 
• Threaded servers use thread per connection 
• Evented servers use non-blocking IO and callbacks 
– Netty 
– Node.js 
– Play 
– Spray
services vs. seconds 
http://www.eecs.berkeley.edu/~rcs/research/interactive_latency.html 
https://www.youtube.com/watch?v=1-vcErOPofQ
Threaded servers 
Service A Service B Service N
Threaded servers 
Service A Service B Service N 
Thread Thread Thread
Threaded servers 
Service A Service B Service N 
Thread Thread Thread 
Thread Thread Thread
Threaded servers 
Service A Service B Service N 
Thread Thread Thread 
Thread Thread Thread 
Thread Thread Thread
Thread 
Service A Service B Service N 
Thread 
Thread 
Threaded servers 
Thread 
Thread 
Thread 
Thread 
Thread 
Thread 
Thread 
Thread 
Thread 
Thread 
Thread 
Thread 
Thread Thread Thread
Thread 
Service A Service B Service N 
Thread 
Thread 
Threaded servers 
Thread 
Thread 
Thread 
Thread 
Thread 
Thread 
Thread 
Thread 
Thread 
Thread 
Thread 
Thread 
Thread Thread Thread
#NonBlocking – Evented servers 
Service A Service B Service N 
Thread Thread Thread 
callback callback
#NonBlocking – Play/Spray 
• Based on Akka using Netty 
– Non-blocking programming much easier 
• Easy deployment 
– Embedded Server 
• Rich JSON and HTTP support 
• Plugins 
– Secure Social 
– Caching 
– …. 
• SCALA!
#NonBlocking – Play example 
…
#AKKA
Backend 
Pre-process Analyze
Spray 
Node 
Dispatch 
Crawling 
library 
Netty 
Price Engine 
Head 
Actor 
… 
Pages 
Level1 Level1 
Level2 
… 
Level2 
File 
writer 
Head 
Actor 
… 
k/v 
Node 
Akka Cluster 
curl http://AkkaCluster/site_dot_com?op=start
#AKKA 
• Based on the Actor Model 
– http://www.reversim.com/2014/04/summit-2014-scale-up-your-thinking.html 
• Resilience 
• Location Transparency 
– Cluster sharding 
– Cluster clients 
• Load Balancing 
• Message Queue Integration
#Containers
What is ? 
• Dockers are like lightweight VM for a single process 
– Self contained 
– No hypervisor 
– Shared kernel, but Isolated and content agnostic 
– No lib conflict 
– No OS boot time 
– Distributing a change is easy, using δ 
• A Clean, Safe, Isolated and Portable Micro Service
Docker File 
• Docker Image is Built From a DockerFile 
• Consists of Descriptive Set of Instructions 
– Start from a base image 
– Run and command 
– Add a file or directory 
– Create an environment variable 
– What process to run on launch
SBT 
• Assemble “Dockerized” micro services 
• We started with sbt-native-packager 
– Poor Docker functionality 
• We ended up with sbt-docker plugin 
– https://github.com/marcuslonnberg/sbt-docker 
– Still Using sbt-native-packager to package 
– Ends up with Docker file
Price Engine Service
#Containers - DockerFile
#Containers – Using SBT
#Containers – Using SBT 
• Using Sequences to optimize 
– Reduce build time 
– Smaller Containers
#Containers – Orchestration 
• CoreOS 
– Linux for massive server deployments 
– Cluster management with Fleet 
– Service discovery with etcd 
• Evaluating 
– Kubernetes 
– Flynn 
– Consul 
– Ambassadord
#AKKA 
Summary 
#NonBloc 
king 
#Containers
Lior Shapsa 
lshapsa@gmail.com 
Twitter: @liorshapsa 
Yardena Meymann 
ymeymann@gmail.com 
Twitter: @ymeymann

Contenu connexe

Tendances

Tendances (20)

Sebastien goasguen cloud stack the next year
Sebastien goasguen   cloud stack the next yearSebastien goasguen   cloud stack the next year
Sebastien goasguen cloud stack the next year
 
(APP309) Running and Monitoring Docker Containers at Scale | AWS re:Invent 2014
(APP309) Running and Monitoring Docker Containers at Scale | AWS re:Invent 2014(APP309) Running and Monitoring Docker Containers at Scale | AWS re:Invent 2014
(APP309) Running and Monitoring Docker Containers at Scale | AWS re:Invent 2014
 
Sebastien goasguen cloud stack and docker
Sebastien goasguen   cloud stack and dockerSebastien goasguen   cloud stack and docker
Sebastien goasguen cloud stack and docker
 
Docker in the Cloud
Docker in the CloudDocker in the Cloud
Docker in the Cloud
 
Observability beyond logging for Java Microservices
Observability beyond logging for Java MicroservicesObservability beyond logging for Java Microservices
Observability beyond logging for Java Microservices
 
Sas 2015 event_driven
Sas 2015 event_drivenSas 2015 event_driven
Sas 2015 event_driven
 
Openstack Overview
Openstack OverviewOpenstack Overview
Openstack Overview
 
MicroServices at Netflix - challenges of scale
MicroServices at Netflix - challenges of scaleMicroServices at Netflix - challenges of scale
MicroServices at Netflix - challenges of scale
 
(DEV302) Hosting ASP.Net 5 Apps in AWS with Docker & AWS CodeDeploy
(DEV302) Hosting ASP.Net 5 Apps in AWS with Docker & AWS CodeDeploy(DEV302) Hosting ASP.Net 5 Apps in AWS with Docker & AWS CodeDeploy
(DEV302) Hosting ASP.Net 5 Apps in AWS with Docker & AWS CodeDeploy
 
Rohit yadav cloud stack internals
Rohit yadav   cloud stack internalsRohit yadav   cloud stack internals
Rohit yadav cloud stack internals
 
Docker for Ops: Docker Networking Deep Dive, Considerations and Troubleshooti...
Docker for Ops: Docker Networking Deep Dive, Considerations and Troubleshooti...Docker for Ops: Docker Networking Deep Dive, Considerations and Troubleshooti...
Docker for Ops: Docker Networking Deep Dive, Considerations and Troubleshooti...
 
Introduction to Akka-Streams
Introduction to Akka-StreamsIntroduction to Akka-Streams
Introduction to Akka-Streams
 
Serverless
ServerlessServerless
Serverless
 
Netflix Open Source Meetup Season 4 Episode 3
Netflix Open Source Meetup Season 4 Episode 3Netflix Open Source Meetup Season 4 Episode 3
Netflix Open Source Meetup Season 4 Episode 3
 
Kubernetes for Serverless - Serverless Summit 2017 - Krishna Kumar
Kubernetes for Serverless  - Serverless Summit 2017 - Krishna KumarKubernetes for Serverless  - Serverless Summit 2017 - Krishna Kumar
Kubernetes for Serverless - Serverless Summit 2017 - Krishna Kumar
 
"[WORKSHOP] K8S for developers", Denis Romanuk
"[WORKSHOP] K8S for developers", Denis Romanuk"[WORKSHOP] K8S for developers", Denis Romanuk
"[WORKSHOP] K8S for developers", Denis Romanuk
 
The Mushroom Cloud Effect or What Happens When Containers Fail? by Alois Mayr...
The Mushroom Cloud Effect or What Happens When Containers Fail? by Alois Mayr...The Mushroom Cloud Effect or What Happens When Containers Fail? by Alois Mayr...
The Mushroom Cloud Effect or What Happens When Containers Fail? by Alois Mayr...
 
DevOpsCon Cloud Workshop
DevOpsCon Cloud Workshop DevOpsCon Cloud Workshop
DevOpsCon Cloud Workshop
 
Develop and Deploy Cloud-Native Apps as Resilient Microservice Architectures
Develop and Deploy Cloud-Native Apps as Resilient Microservice ArchitecturesDevelop and Deploy Cloud-Native Apps as Resilient Microservice Architectures
Develop and Deploy Cloud-Native Apps as Resilient Microservice Architectures
 
Innovating faster with SBT, Continuous Delivery, and LXC
Innovating faster with SBT, Continuous Delivery, and LXCInnovating faster with SBT, Continuous Delivery, and LXC
Innovating faster with SBT, Continuous Delivery, and LXC
 

En vedette

En vedette (20)

Microservices in Scala: Play Framework
Microservices in Scala: Play FrameworkMicroservices in Scala: Play Framework
Microservices in Scala: Play Framework
 
Microservices in Scala - theory & practice
Microservices in Scala - theory & practiceMicroservices in Scala - theory & practice
Microservices in Scala - theory & practice
 
Building microservices with Scala, functional domain models and Spring Boot
Building microservices with Scala, functional domain models and Spring BootBuilding microservices with Scala, functional domain models and Spring Boot
Building microservices with Scala, functional domain models and Spring Boot
 
Sharepoint, Liferay & Co.: Social Business Integration in der Praxis
Sharepoint, Liferay & Co.: Social Business Integration in der PraxisSharepoint, Liferay & Co.: Social Business Integration in der Praxis
Sharepoint, Liferay & Co.: Social Business Integration in der Praxis
 
Five things I learned about information security
Five things I learned about information securityFive things I learned about information security
Five things I learned about information security
 
Real World Scalaz
Real World ScalazReal World Scalaz
Real World Scalaz
 
building blocks of a scalable webcrawler
building blocks of a scalable webcrawlerbuilding blocks of a scalable webcrawler
building blocks of a scalable webcrawler
 
Zalando Tech: From Java to Scala in Less Than Three Months
Zalando Tech: From Java to Scala in Less Than Three MonthsZalando Tech: From Java to Scala in Less Than Three Months
Zalando Tech: From Java to Scala in Less Than Three Months
 
Vert.X: Microservices Were Never So Easy (Clement Escoffier)
Vert.X: Microservices Were Never So Easy (Clement Escoffier)Vert.X: Microservices Were Never So Easy (Clement Escoffier)
Vert.X: Microservices Were Never So Easy (Clement Escoffier)
 
Microservices and functional programming
Microservices and functional programmingMicroservices and functional programming
Microservices and functional programming
 
Building and deploying microservices with event sourcing, CQRS and Docker (Ha...
Building and deploying microservices with event sourcing, CQRS and Docker (Ha...Building and deploying microservices with event sourcing, CQRS and Docker (Ha...
Building and deploying microservices with event sourcing, CQRS and Docker (Ha...
 
Web Crawling and Data Gathering with Apache Nutch
Web Crawling and Data Gathering with Apache NutchWeb Crawling and Data Gathering with Apache Nutch
Web Crawling and Data Gathering with Apache Nutch
 
How to hack into the big data team
How to hack into the big data teamHow to hack into the big data team
How to hack into the big data team
 
Automated Security Hardening with OpenStack-Ansible
Automated Security Hardening with OpenStack-AnsibleAutomated Security Hardening with OpenStack-Ansible
Automated Security Hardening with OpenStack-Ansible
 
Shift: Real World Migration from MongoDB to Cassandra
Shift: Real World Migration from MongoDB to CassandraShift: Real World Migration from MongoDB to Cassandra
Shift: Real World Migration from MongoDB to Cassandra
 
Spark streaming with kafka
Spark streaming with kafkaSpark streaming with kafka
Spark streaming with kafka
 
Code Your Agility - Tips for Boosting Technical Agility in Your Organization
Code Your Agility - Tips for Boosting Technical Agility in Your OrganizationCode Your Agility - Tips for Boosting Technical Agility in Your Organization
Code Your Agility - Tips for Boosting Technical Agility in Your Organization
 
Securing Microservices using Play and Akka HTTP
Securing Microservices using Play and Akka HTTPSecuring Microservices using Play and Akka HTTP
Securing Microservices using Play and Akka HTTP
 
Resilient Applications with Akka Persistence - Scaladays 2014
Resilient Applications with Akka Persistence - Scaladays 2014Resilient Applications with Akka Persistence - Scaladays 2014
Resilient Applications with Akka Persistence - Scaladays 2014
 
Spring Boot Microservices vs Akka Actor Cluster
Spring Boot Microservices vs Akka Actor Cluster Spring Boot Microservices vs Akka Actor Cluster
Spring Boot Microservices vs Akka Actor Cluster
 

Similaire à Building Micro-Services with Scala

Performance of Microservice Frameworks on different JVMs
Performance of Microservice Frameworks on different JVMsPerformance of Microservice Frameworks on different JVMs
Performance of Microservice Frameworks on different JVMs
Maarten Smeets
 
Docker - Portable Deployment
Docker - Portable DeploymentDocker - Portable Deployment
Docker - Portable Deployment
javaonfly
 

Similaire à Building Micro-Services with Scala (20)

Rami Sayar - Node microservices with Docker
Rami Sayar - Node microservices with DockerRami Sayar - Node microservices with Docker
Rami Sayar - Node microservices with Docker
 
Integration in the Age of DevOps
Integration in the Age of DevOpsIntegration in the Age of DevOps
Integration in the Age of DevOps
 
Cloud Native Camel Riding
Cloud Native Camel RidingCloud Native Camel Riding
Cloud Native Camel Riding
 
Fuse integration-services
Fuse integration-servicesFuse integration-services
Fuse integration-services
 
Node.js meetup at Palo Alto Networks Tel Aviv
Node.js meetup at Palo Alto Networks Tel AvivNode.js meetup at Palo Alto Networks Tel Aviv
Node.js meetup at Palo Alto Networks Tel Aviv
 
Micro services
Micro servicesMicro services
Micro services
 
The Future of SDN in CloudStack by Chiradeep Vittal
The Future of SDN in CloudStack by Chiradeep VittalThe Future of SDN in CloudStack by Chiradeep Vittal
The Future of SDN in CloudStack by Chiradeep Vittal
 
Microservices Runtimes
Microservices RuntimesMicroservices Runtimes
Microservices Runtimes
 
Chicago Microservices Integration Talk
Chicago Microservices Integration TalkChicago Microservices Integration Talk
Chicago Microservices Integration Talk
 
Container Networking Deep Dive
Container Networking Deep DiveContainer Networking Deep Dive
Container Networking Deep Dive
 
We don't need consensus: All agreed?
We don't need consensus: All agreed?We don't need consensus: All agreed?
We don't need consensus: All agreed?
 
Performance of Microservice Frameworks on different JVMs
Performance of Microservice Frameworks on different JVMsPerformance of Microservice Frameworks on different JVMs
Performance of Microservice Frameworks on different JVMs
 
Docker - Portable Deployment
Docker - Portable DeploymentDocker - Portable Deployment
Docker - Portable Deployment
 
Net Devops Overview
Net Devops OverviewNet Devops Overview
Net Devops Overview
 
Directions for CloudStack Networking
Directions for CloudStack  NetworkingDirections for CloudStack  Networking
Directions for CloudStack Networking
 
Monolithic to Microservices Architecture
Monolithic to Microservices ArchitectureMonolithic to Microservices Architecture
Monolithic to Microservices Architecture
 
Microservices
MicroservicesMicroservices
Microservices
 
Microservices Platforms - Which is Best?
Microservices Platforms - Which is Best?Microservices Platforms - Which is Best?
Microservices Platforms - Which is Best?
 
JavaEE Microservices platforms
JavaEE Microservices platformsJavaEE Microservices platforms
JavaEE Microservices platforms
 
Cont0519
Cont0519Cont0519
Cont0519
 

Plus de Yardena Meymann (7)

Writing Asynchronous Programs with Scala & Akka
Writing Asynchronous Programs with Scala & AkkaWriting Asynchronous Programs with Scala & Akka
Writing Asynchronous Programs with Scala & Akka
 
Scale up your thinking
Scale up your thinkingScale up your thinking
Scale up your thinking
 
Jenkins Reviewbot
Jenkins ReviewbotJenkins Reviewbot
Jenkins Reviewbot
 
Concurrency in Scala - the Akka way
Concurrency in Scala - the Akka wayConcurrency in Scala - the Akka way
Concurrency in Scala - the Akka way
 
All about scala
All about scalaAll about scala
All about scala
 
Scala introduction
Scala introductionScala introduction
Scala introduction
 
Scala at HUJI PL Seminar 2008
Scala at HUJI PL Seminar 2008Scala at HUJI PL Seminar 2008
Scala at HUJI PL Seminar 2008
 

Dernier

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Dernier (20)

Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 

Building Micro-Services with Scala

  • 1. Building Micro-Services with Scala Lior Shapsa, Yardena Meymann September 22, 2014 © 2014 VMware Inc. All rights reserved.
  • 4. Problems with Monoliths • Size • Integration (Conway’s law) • Modules Change at Different Rates • Dependencies Collisions • Scalability requirements of modules FEAR OF CHANGE FEAR OF INNOVATION
  • 6. Thought Leaders Netflix, Amazon, LinkedIn, Google, ThoughtWorks, Gilt, … Fred George Martin Fowler Kit Colbert Ben Fathi Stefan Tilkov VMware
  • 7. What are micro-services? A set of narrowly focused,
  • 8. What are micro-services? A set of narrowly focused, independently deployable services,
  • 9. What are micro-services? A set of narrowly focused, independently deployable services, talking via uniform interfaces
  • 10. What are micro-services? A set of narrowly focused, independently deployable services, talking via uniform interfaces
  • 11. Micro-services • Each running in its own process • Communicating with lightweight mechanisms, often an HTTP resource API • Built around business capabilities • Independently deployable – fully automated deployment • May be in a different programming language and use different data storage technologies.
  • 12. Micro-services DEPLOYING A CHANGE IS LOW RISK
  • 14. Threaded vs. Evented Servers • Monolithic – Most modules communicate in-process • Micro-services – communicate remotely, often over the network – need to support cheap, lightweight remote communication • Threaded servers use thread per connection • Evented servers use non-blocking IO and callbacks – Netty – Node.js – Play – Spray
  • 15. services vs. seconds http://www.eecs.berkeley.edu/~rcs/research/interactive_latency.html https://www.youtube.com/watch?v=1-vcErOPofQ
  • 16. Threaded servers Service A Service B Service N
  • 17. Threaded servers Service A Service B Service N Thread Thread Thread
  • 18. Threaded servers Service A Service B Service N Thread Thread Thread Thread Thread Thread
  • 19. Threaded servers Service A Service B Service N Thread Thread Thread Thread Thread Thread Thread Thread Thread
  • 20. Thread Service A Service B Service N Thread Thread Threaded servers Thread Thread Thread Thread Thread Thread Thread Thread Thread Thread Thread Thread Thread Thread Thread
  • 21. Thread Service A Service B Service N Thread Thread Threaded servers Thread Thread Thread Thread Thread Thread Thread Thread Thread Thread Thread Thread Thread Thread Thread
  • 22. #NonBlocking – Evented servers Service A Service B Service N Thread Thread Thread callback callback
  • 23. #NonBlocking – Play/Spray • Based on Akka using Netty – Non-blocking programming much easier • Easy deployment – Embedded Server • Rich JSON and HTTP support • Plugins – Secure Social – Caching – …. • SCALA!
  • 24. #NonBlocking – Play example …
  • 25. #AKKA
  • 27. Spray Node Dispatch Crawling library Netty Price Engine Head Actor … Pages Level1 Level1 Level2 … Level2 File writer Head Actor … k/v Node Akka Cluster curl http://AkkaCluster/site_dot_com?op=start
  • 28. #AKKA • Based on the Actor Model – http://www.reversim.com/2014/04/summit-2014-scale-up-your-thinking.html • Resilience • Location Transparency – Cluster sharding – Cluster clients • Load Balancing • Message Queue Integration
  • 30. What is ? • Dockers are like lightweight VM for a single process – Self contained – No hypervisor – Shared kernel, but Isolated and content agnostic – No lib conflict – No OS boot time – Distributing a change is easy, using δ • A Clean, Safe, Isolated and Portable Micro Service
  • 31. Docker File • Docker Image is Built From a DockerFile • Consists of Descriptive Set of Instructions – Start from a base image – Run and command – Add a file or directory – Create an environment variable – What process to run on launch
  • 32. SBT • Assemble “Dockerized” micro services • We started with sbt-native-packager – Poor Docker functionality • We ended up with sbt-docker plugin – https://github.com/marcuslonnberg/sbt-docker – Still Using sbt-native-packager to package – Ends up with Docker file
  • 36. #Containers – Using SBT • Using Sequences to optimize – Reduce build time – Smaller Containers
  • 37. #Containers – Orchestration • CoreOS – Linux for massive server deployments – Cluster management with Fleet – Service discovery with etcd • Evaluating – Kubernetes – Flynn – Consul – Ambassadord
  • 38. #AKKA Summary #NonBloc king #Containers
  • 39.
  • 40.
  • 41.
  • 42. Lior Shapsa lshapsa@gmail.com Twitter: @liorshapsa Yardena Meymann ymeymann@gmail.com Twitter: @ymeymann

Notes de l'éditeur

  1. Messaging – Kafka Resilience - Handles Failures with Supervision
  2. We write unit files that tells the CoreOS fleet scheduler how to deploy our Docker containers. We will use the etcd key-value store to communicate between our application containers.
  3. Logs Monitoring
  4. Logs Monitoring
  5. Logs Monitoring