Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Altitude SF 2017: Nomad and next-gen application architectures

642 views

Published on

Armon Dadgar offers an overview of Nomad, an application scheduler designed for both long-running services and batch jobs. Along the way, Armon explores the benefits of using schedulers for empowering developers and increasing resource utilization and how schedulers enable new next-generation application architectures.

Published in: Technology
  • Real Money Streams ~ Create multiple streams of wealth from your home! ♣♣♣ http://scamcb.com/ezpayjobs/pdf
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Be the first to like this

Altitude SF 2017: Nomad and next-gen application architectures

  1. 1. Nomad and next-generation application architectures
  2. 2. Armon Dadgar Founder and CTO @armon
  3. 3. HashiCorpSuite CONNECT RUN SECURE PROVISION Infrastructure & applications Applications Infrastructure & applications Infrastructure Consul Nomad Terraform Vault Packer Vagrant Consul Enterprise Nomad Enterprise Vault Enterprise Terraform Enterprise FOR TEAMS OSS TOOL SUITE PRODUCT SUITE
  4. 4. Nomad Cluster Manager Scheduler
  5. 5. Nomad Cluster Manager Scheduler
  6. 6. Schedulers map a set of work to a set of resources
  7. 7. CPU Scheduler Web Server -Thread 1 CPU - Core 1 CPU - Core 2 Web Server -Thread 2 Redis -Thread 1 Kernel -Thread 1 Work (Input) Resources CPU Scheduler
  8. 8. Advantages Higher Resource Utilization Decouple Work from Resources Better Quality of Service
  9. 9. Schedulers in the Wild Type Work Resources CPU Scheduler Threads Physical Cores AWS EC2 / OpenStack Nova Virtual Machines Hypervisors Hadoop YARN MapReduce Jobs Client Nodes Cluster Scheduler Applications Servers
  10. 10. Nomad Cluster Scheduler Easily Deploy Applications Operationally Simple Built for Scale API for Next-Gen Patterns
  11. 11. job "redis" { datacenters = ["us-east-1"] task "redis" { driver = "docker" config { image = "redis:latest" } resources { cpu = 500 # Mhz memory = 256 # MB network { mbits = 10 port “redis" {} } } } } example.nomad
  12. 12. Declares what to run
  13. 13. Nomad determines where and manages how to run
  14. 14. Nomad Declarative Jobs Infrastructure as Code Consul Integration Vault Integration Composable vs Platform
  15. 15. Operationally Simple & Scalable
  16. 16. Nomad Single Binary No Dependencies Highly Available Multi-DC/Region Support
  17. 17. Built on Research & Experience GOSSIP CONSENSUS Mature Libraries Proven Design Patterns
  18. 18. Nomad Inspired by Google Omega Optimistic Concurrency Service & Batch workloads Pluggable Architecture
  19. 19. Next-Gen Patterns
  20. 20. MonolithMicro-Service SOA Spectrum
  21. 21. MonolithMicro-Service SOA Spectrum Utility of Service
  22. 22. Monoliths have high application complexity
  23. 23. Microservices have high operational complexity
  24. 24. Abstractions allow us to scale complexity
  25. 25. Frameworks :: Monoliths Schedulers :: Services
  26. 26. Schedulers abstract details, focus on service composition
  27. 27. Side Cars • Sidecar or Co-Process Pattern • Application that runs alongside “main” process • Nomad “Task Group” • Borg “Alloc” • Kubernetes “Pod”
  28. 28. Side Cars • Configuration (Consul-Template) • Logging Agents (Splunk, CloudWatch) • Telemetry Agents (Datadog) • Service Mesh (Envoy, Linkerd) • Load Balancing (HAProxy, Nginx, Fabio)
  29. 29. Nomad Transparent Scheduling API awareness Dynamic Behavior
  30. 30. Queues
  31. 31. Queues • Workers are online service doing batch work • Workers provisioned in advance • N+1 instances for high availability • Typically idle or underutilized
  32. 32. Nomad Dispatch • “Dispatch” a worker for each incoming event • Consumer launched on-demand and terminates when done • Publisher shielded from implementation detail • Nomad job acts like a future, queues when busy • Avoids underutilization
  33. 33. job “my-dispatch” { datacenter = [“dc1”] type = “batch” parameterized { meta_required = [“input”] } task “worker” { driver = “docker” config = { image = “myworker:latest” args = [“—input”, “${NOMAD_META_INPUT}”] }
 } } my-dispatch.job
  34. 34. Nomad Server Register Dispatch Job
  35. 35. Nomad Server Register Dispatch Job Web Server Dispatch
  36. 36. Nomad Server Register Dispatch Job Web Server Dispatch Worker 1 Schedule
  37. 37. Nomad Server Register Dispatch Job Web Server Dispatch Worker 1 Schedule Worker 2 Worker N
  38. 38. Function-as-a-Service • AWS Lambda • Small Granularity • Low Volume, Latency Insensitive => Nomad Dispatch • High Volume, Latency Sensitive => Setup Overhead Prohibitive
  39. 39. FaaS / Serverless • Process multiple events per worker • Dynamically scale workers • Queue messages to avoid dropping
  40. 40. Nomad Server Register Dispatch Job Controller
  41. 41. Nomad Server Register Dispatch Job Web Server Push Controller Dispatch
  42. 42. Nomad Server Register Dispatch Job Web Server Push Worker 1 Schedule Controller Pull Dispatch
  43. 43. Nomad Server Register Dispatch Job Web Server Push Worker 1 Schedule Controller Pull Dispatch Deep Message Queue
  44. 44. Nomad Server Register Dispatch Job Web Server Push Worker 1 Schedule Worker 2 Worker NController Pull Dispatch
  45. 45. Big Data Processing • Large scale batch workload • Graph of processing steps • Each phase dynamic size • Programmatically setup/teardown workers • Native Spark Integration!
  46. 46. Nomad Server Executor 1 Schedule Executor 2 Executor N Launch Executors Submit Job
  47. 47. Scheduler API blurs line between Application and Infrastructure
  48. 48. Nomad Cluster Scheduler Easily Deploy Applications Operationally Simple Built for Scale API for Next-Gen Patterns
  49. 49. Thanks! @armon

×