SlideShare a Scribd company logo
Game On!
Exploring Microservices with a
Text-Based Adventure
Erin Schnabel @ebullientworks
September 2016
Microservices are used to…
• compose a complex application using
– “small”
– independent (autonomous)
– replaceable
– processes
• that communicate via
– language-agnostic APIs
Microservice
MicroserviceMicroservice
Microservice
Microservices application
Subscribe
REST
(JSON/HTTP)
Microservice
Microservice
broker
API
Microservice
Publish
API
REST
(JSON/HTTP)
Publish
Service
Registry
API
Microservice
Why?
• Accommodate differences
– SQL, NoSQL, Graph…
– Change cycles
– Scaling profiles
– Security zoning
• Facilitate growth
– Polyglot explosion
• Agility!
– Bounded context
(code + data)
– Faster iteration cycles
• Reduce risk  try new things
– Isolate legacy vs. unknown
https://twitter.com/adrianco/status/441883572618948608
“Twitter microservices
map looks just like the
Netflix one. We called
this the ‘Death Star’
diagram”
— Adrian Cockcroft
via twitter
Interaction patterns
Fallacies of distributed computing
• The network is reliable
• Latency is zero
• Bandwidth is infinite
• The network is secure
• Topology doesn’t change
• There is one administrator
• Transport cost is zero
• The network is homogenous
-- L Peter Deutsch, 1994
https://en.wikipedia.org/wiki/Fallacies_of_distributed_computing
Eventual consistency
Bounded Contexts
DevOps
Automation
Conway’s law
Testing?
Microservices Sample Apps…
• Create a single service
• Rebuild a pre-baked microservices application
7
Clueless
No idea
Confident
Has read all the
things!
Experienced
Hands-on understanding
Puzzled / Realistic
Challenges are real
The premise …
• Hands on with microservices
• Stick with ’Hello World’ simplicity
• Choose your own adventure
• Fast path to the hard stuff
• Build something cool (to you!)
• Learn as you go
/go N
Retro, text-only interface
Status updates
Simple text commands
kafkaELK amalgam8couchdb
room
PlayerAuth
SweepProxystatic
MediatorMap
This is what
we run
kafkaELK amalgam8couchdb
room
PlayerAuth
SweepProxystatic
MediatorMap
Rooms are what
you build.
What happens when…
1. Build a basic room
2. Scale that room (multiple instances)
– Where are players?
– What about items or shared state?
– Latency, managing calls to additional services
Exploration of solutions for caching, circuit breakers, service interaction patterns
12
Twelve Factors
Twelve factor applications
• “a methodology for building
software-as-a-service applications”
– Created by developers at Heroku
• Factors are independent of
– programming language,
– backing services,
– cloud provider
• http://12factor.net/
Git + Submodules (Factor 1: codebase)
• Root repository: https://github.com/gameontext/gameon
– Optional use of submodules
• Key: Only builds update submodule commit levels
– Prevents conflicts and confusion caused by humans
15
Containers
• Encapsulation of all dependencies
• Parity: dev -> test -> prod
• Configuration passed in via environment
• Local: Docker Compose or Vagrant
– Pre-built images in dockerhub (this came later.. )
– Overlays for local editing
• Independent build pipelines per service to deploy containers
16
(Factor 2: dependencies, 5: build/release/run,
6: Processes, 8: concurrency, 10: dev/prod
parity)
Liberty (Factor 2, 10, 3: config, 4: backing services, 7: port binding, 9:
disposability)
• Java services are Liberty-based
• Customizable features: Cachable Docker Layers
– Explicit app server dependencies
– Self-contained immutable artifact
– Smaller war (smaller delta)
• Environment variables in server config
– Common configuration across environments
– Config munging not necessary
– Composable configuration w/ dropins if required
<couchdb id="couchdb"
jndiName="couchdb/connector"
libraryRef="couchdb-lib"
password="${env.COUCHDB_PASSWORD}"
url="${env.COUCHDB_SERVICE_URL}"
username="${env.COUCHDB_USER}"/>
17
Service composition
ELK mongo
room
Player
Proxy
JSON/HTTP (REST)
Concierge
• Player managed ”all interactions with the player”
• Concierge: tell player service which room is next
(/go N)
• Room (had to have one!)
ELK mongo
room
Player
Proxy
JSON/HTTP (REST)
Concierge
• Language separation
• Scaling worries
– websockets are long-running
– Simple CRUD operations
static
Mediator
ELK couchdb
room
Player
Proxy
JSON/HTTP (REST)
Concierge
• Bad metaphor
– Concierge just hands out keys
– Room registration required knowledge of neighbors
static
MediatorMap
kafkaELK couchdb
room
PlayerAuth
SweepProxystatic
MediatorMap
Messaging / Events
Serverless (time)
Security
OAuth & JWTs
• OAuth proxy
– Application id w/ different front-end
– Could be a gateway instead
• Access token converted into signed JWT
• System services deal only with JWT
– game-on.org SSL certificate
– Well-known public key
24
Hashed message authentication codes
(HMACs)
• Shared secrets
– Credentials not sent on the wire
– Used to verify identity of sender
• Map operations
– Mutable operations require HMAC signature
– Hashed signature used to prevent replays
• Room handshake for WebSocket
– It is the game calling the room
– Room answering the game
• https://book.game-on.org/microservices/ApplicationSecurity.html
25
Shared Library
Service discovery
Service registration and discovery
• Required for load balancing and scaling
• Services need to find each other
• Environment changes constantly
• Client-side or server-side?
• Client library, sidecar, or proxy?
Microservice
Microservice
Microservice
Service
Registry
Client library
Service
Proxy
app
sidecar
• Basics
– Service registration
– Service discovery
– Client-side load balancing
• How
– Sidecar model. 2 options:
• An independent process running in the same container as the app
• An independent container running in the same pod as the app
container
Successful?
Game On! Exploring Microservices with a Text-Based Adventure Game
Questions?
Thank You!
Erin Schnabel | schnabel@us.ibm.com | @ebullientworks
Play – http://game-on.org
Learn more – http://book.game-on.org

More Related Content

PPTX
My internwork
 
PPTX
XML Key Management Protocol for Secure Web Service
PPTX
Discovering Vulnerabilities For Fun and Profit
PDF
Luniverse Partners Day - Jay
PPTX
20190606 blockchain101
PDF
Доклад разработчиков Exonum на третьем митапе сообщества блокчейн-разработчик...
PPTX
ENABLING THE E-CITIZEN IN A DISTRIBUTED ENVIRONMENT
PDF
Introduction of Luniverse
My internwork
 
XML Key Management Protocol for Secure Web Service
Discovering Vulnerabilities For Fun and Profit
Luniverse Partners Day - Jay
20190606 blockchain101
Доклад разработчиков Exonum на третьем митапе сообщества блокчейн-разработчик...
ENABLING THE E-CITIZEN IN A DISTRIBUTED ENVIRONMENT
Introduction of Luniverse

What's hot (10)

PDF
Hyperledger Fabric EVM Integration Feb 20, 2018
PDF
Hyperledger Cello Feb 20, 2018
PPTX
ROS - an open-source Robot Operating System
PPTX
NGSIv2 Overview for Developers That Already Know NGSIv1
PDF
Microservices: The OSGi way A different vision on microservices
PPT
Agents and P2P Networks
PDF
Hyperledger community update 201805
PPTX
Transforming monolith systems to microservices
PDF
Доклад Владимира Бичева на третьем митапе сообщества блокчейн-разработчиков С...
PPTX
20180711 Metamask
Hyperledger Fabric EVM Integration Feb 20, 2018
Hyperledger Cello Feb 20, 2018
ROS - an open-source Robot Operating System
NGSIv2 Overview for Developers That Already Know NGSIv1
Microservices: The OSGi way A different vision on microservices
Agents and P2P Networks
Hyperledger community update 201805
Transforming monolith systems to microservices
Доклад Владимира Бичева на третьем митапе сообщества блокчейн-разработчиков С...
20180711 Metamask
Ad

Viewers also liked (12)

PDF
CDI Best Practices with Real-Life Examples - TUT3287
PPT
Don't Wait! Develop responsive applications with Java EE7 instead
PPT
12-factor applications using WAS Liberty, IBM Bluemix, and Docker
PDF
IBM InterConnect: Java vs JavaScript for Enterprise WebApps
PDF
Secure Your APIs with Amazon API Gateway
PPT
Evolving a monolithic Java EE application to microservices
PDF
Security enforcement of Java Microservices with Apiman & Keycloak
PDF
muCon 2016: Authentication in Microservice Systems By David Borsos
PDF
API Connect Presentation
PDF
Hardening Microservices Security: Building a Layered Defense Strategy
PDF
Handling Eventual Consistency in JVM Microservices with Event Sourcing (javao...
PDF
Build Features, Not Apps
CDI Best Practices with Real-Life Examples - TUT3287
Don't Wait! Develop responsive applications with Java EE7 instead
12-factor applications using WAS Liberty, IBM Bluemix, and Docker
IBM InterConnect: Java vs JavaScript for Enterprise WebApps
Secure Your APIs with Amazon API Gateway
Evolving a monolithic Java EE application to microservices
Security enforcement of Java Microservices with Apiman & Keycloak
muCon 2016: Authentication in Microservice Systems By David Borsos
API Connect Presentation
Hardening Microservices Security: Building a Layered Defense Strategy
Handling Eventual Consistency in JVM Microservices with Event Sourcing (javao...
Build Features, Not Apps
Ad

Similar to Game On! Exploring Microservices with a Text-Based Adventure Game (20)

PPTX
.Net Microservices with Event Sourcing, CQRS, Docker and... Windows Server 20...
PPTX
Microservices: Yes or not?
PDF
Microservice pitfalls
PPTX
Microservices in Action
PPTX
Building fast,scalable game server in node.js
PDF
Combining the Strengths or Erlang and Ruby
PDF
Combining the strength of erlang and Ruby
PDF
Orleans gdc2019
PPTX
Microservices With SenecaJS
PPTX
Building 12-factor Cloud Native Microservices
PPTX
Microservices with SenecaJS (part 2)
PPTX
Game server development in node.js in jsconf eu
PPTX
Tef con2016 (1)
PPTX
Pros and Cons of a MicroServices Architecture talk at AWS ReInvent
PPTX
Intro to spring cloud &microservices by Eugene Hanikblum
PDF
Live Coding 12 Factor App
PPTX
Scalable game-servers-tgc
PPT
Building an ActionScript Game Server with over 15,000 Concurrent Connections
PPTX
Photon Session / Unite12 Conference
PDF
RedisConf18 - Common Redis Use Cases for Cloud Native Apps and Microservices
.Net Microservices with Event Sourcing, CQRS, Docker and... Windows Server 20...
Microservices: Yes or not?
Microservice pitfalls
Microservices in Action
Building fast,scalable game server in node.js
Combining the Strengths or Erlang and Ruby
Combining the strength of erlang and Ruby
Orleans gdc2019
Microservices With SenecaJS
Building 12-factor Cloud Native Microservices
Microservices with SenecaJS (part 2)
Game server development in node.js in jsconf eu
Tef con2016 (1)
Pros and Cons of a MicroServices Architecture talk at AWS ReInvent
Intro to spring cloud &microservices by Eugene Hanikblum
Live Coding 12 Factor App
Scalable game-servers-tgc
Building an ActionScript Game Server with over 15,000 Concurrent Connections
Photon Session / Unite12 Conference
RedisConf18 - Common Redis Use Cases for Cloud Native Apps and Microservices

Recently uploaded (20)

PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PPTX
A Presentation on Artificial Intelligence
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Encapsulation theory and applications.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
sap open course for s4hana steps from ECC to s4
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
Cloud computing and distributed systems.
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Electronic commerce courselecture one. Pdf
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Assigned Numbers - 2025 - Bluetooth® Document
gpt5_lecture_notes_comprehensive_20250812015547.pdf
A Presentation on Artificial Intelligence
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Encapsulation theory and applications.pdf
Chapter 3 Spatial Domain Image Processing.pdf
sap open course for s4hana steps from ECC to s4
The Rise and Fall of 3GPP – Time for a Sabbatical?
Encapsulation_ Review paper, used for researhc scholars
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Cloud computing and distributed systems.
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Spectral efficient network and resource selection model in 5G networks
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
A comparative analysis of optical character recognition models for extracting...
Advanced methodologies resolving dimensionality complications for autism neur...
Electronic commerce courselecture one. Pdf
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Assigned Numbers - 2025 - Bluetooth® Document

Game On! Exploring Microservices with a Text-Based Adventure Game

  • 1. Game On! Exploring Microservices with a Text-Based Adventure Erin Schnabel @ebullientworks September 2016
  • 2. Microservices are used to… • compose a complex application using – “small” – independent (autonomous) – replaceable – processes • that communicate via – language-agnostic APIs Microservice MicroserviceMicroservice Microservice Microservices application Subscribe REST (JSON/HTTP) Microservice Microservice broker API Microservice Publish API REST (JSON/HTTP) Publish Service Registry API Microservice
  • 3. Why? • Accommodate differences – SQL, NoSQL, Graph… – Change cycles – Scaling profiles – Security zoning • Facilitate growth – Polyglot explosion • Agility! – Bounded context (code + data) – Faster iteration cycles • Reduce risk  try new things – Isolate legacy vs. unknown
  • 4. https://twitter.com/adrianco/status/441883572618948608 “Twitter microservices map looks just like the Netflix one. We called this the ‘Death Star’ diagram” — Adrian Cockcroft via twitter Interaction patterns
  • 5. Fallacies of distributed computing • The network is reliable • Latency is zero • Bandwidth is infinite • The network is secure • Topology doesn’t change • There is one administrator • Transport cost is zero • The network is homogenous -- L Peter Deutsch, 1994 https://en.wikipedia.org/wiki/Fallacies_of_distributed_computing
  • 7. Microservices Sample Apps… • Create a single service • Rebuild a pre-baked microservices application 7 Clueless No idea Confident Has read all the things! Experienced Hands-on understanding Puzzled / Realistic Challenges are real
  • 8. The premise … • Hands on with microservices • Stick with ’Hello World’ simplicity • Choose your own adventure • Fast path to the hard stuff • Build something cool (to you!) • Learn as you go
  • 9. /go N Retro, text-only interface Status updates Simple text commands
  • 12. What happens when… 1. Build a basic room 2. Scale that room (multiple instances) – Where are players? – What about items or shared state? – Latency, managing calls to additional services Exploration of solutions for caching, circuit breakers, service interaction patterns 12
  • 14. Twelve factor applications • “a methodology for building software-as-a-service applications” – Created by developers at Heroku • Factors are independent of – programming language, – backing services, – cloud provider • http://12factor.net/
  • 15. Git + Submodules (Factor 1: codebase) • Root repository: https://github.com/gameontext/gameon – Optional use of submodules • Key: Only builds update submodule commit levels – Prevents conflicts and confusion caused by humans 15
  • 16. Containers • Encapsulation of all dependencies • Parity: dev -> test -> prod • Configuration passed in via environment • Local: Docker Compose or Vagrant – Pre-built images in dockerhub (this came later.. ) – Overlays for local editing • Independent build pipelines per service to deploy containers 16 (Factor 2: dependencies, 5: build/release/run, 6: Processes, 8: concurrency, 10: dev/prod parity)
  • 17. Liberty (Factor 2, 10, 3: config, 4: backing services, 7: port binding, 9: disposability) • Java services are Liberty-based • Customizable features: Cachable Docker Layers – Explicit app server dependencies – Self-contained immutable artifact – Smaller war (smaller delta) • Environment variables in server config – Common configuration across environments – Config munging not necessary – Composable configuration w/ dropins if required <couchdb id="couchdb" jndiName="couchdb/connector" libraryRef="couchdb-lib" password="${env.COUCHDB_PASSWORD}" url="${env.COUCHDB_SERVICE_URL}" username="${env.COUCHDB_USER}"/> 17
  • 19. ELK mongo room Player Proxy JSON/HTTP (REST) Concierge • Player managed ”all interactions with the player” • Concierge: tell player service which room is next (/go N) • Room (had to have one!)
  • 20. ELK mongo room Player Proxy JSON/HTTP (REST) Concierge • Language separation • Scaling worries – websockets are long-running – Simple CRUD operations static Mediator
  • 21. ELK couchdb room Player Proxy JSON/HTTP (REST) Concierge • Bad metaphor – Concierge just hands out keys – Room registration required knowledge of neighbors static MediatorMap
  • 24. OAuth & JWTs • OAuth proxy – Application id w/ different front-end – Could be a gateway instead • Access token converted into signed JWT • System services deal only with JWT – game-on.org SSL certificate – Well-known public key 24
  • 25. Hashed message authentication codes (HMACs) • Shared secrets – Credentials not sent on the wire – Used to verify identity of sender • Map operations – Mutable operations require HMAC signature – Hashed signature used to prevent replays • Room handshake for WebSocket – It is the game calling the room – Room answering the game • https://book.game-on.org/microservices/ApplicationSecurity.html 25 Shared Library
  • 27. Service registration and discovery • Required for load balancing and scaling • Services need to find each other • Environment changes constantly • Client-side or server-side? • Client library, sidecar, or proxy? Microservice Microservice Microservice Service Registry Client library Service Proxy app sidecar
  • 28. • Basics – Service registration – Service discovery – Client-side load balancing • How – Sidecar model. 2 options: • An independent process running in the same container as the app • An independent container running in the same pod as the app container
  • 32. Thank You! Erin Schnabel | schnabel@us.ibm.com | @ebullientworks Play – http://game-on.org Learn more – http://book.game-on.org