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

What's hot (10)

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

Viewers also liked (12)

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

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

PDF
Node.js
Matt Simonis
 
PPTX
.Net Microservices with Event Sourcing, CQRS, Docker and... Windows Server 20...
Javier García Magna
 
PPTX
Alex lakatos state of mobile web
Codecamp Romania
 
PDF
Matrix, The Year To Date, Ben Parsons, TADSummit 2018
Alan Quayle
 
PDF
Metarhia: Node.js Macht Frei
Timur Shemsedinov
 
ODP
Node.js architecture (EN)
Timur Shemsedinov
 
PPTX
Hyperledger Fabric Update - June 2018
Arnaud Le Hors
 
KEY
20120306 dublin js
Richard Rodger
 
PDF
Open source building blocks for the Internet of Things - Jfokus 2013
Benjamin Cabé
 
PDF
XPDS14: OpenXT - Security and the Properties of a Xen Virtualisation Platform...
The Linux Foundation
 
PDF
John adams talk cloudy
John Adams
 
PPTX
Cloud for Game Developers – Myth or Real Scenarios?
DevGAMM Conference
 
PDF
Vert.x introduction
GR8Conf
 
PPTX
Summer 2017 undergraduate research powerpoint
Christopher Dubois
 
PPTX
Debugging the Web with Fiddler
Ido Flatow
 
PDF
RPC in Smalltalk
ESUG
 
PPTX
Exploring microservices in a Microsoft landscape
Alex Thissen
 
PDF
Chirp 2010: Scaling Twitter
John Adams
 
PPTX
Be faster then rabbits
Vladislav Bauer
 
PPTX
Cont0519
Samuel Dratwa
 
Node.js
Matt Simonis
 
.Net Microservices with Event Sourcing, CQRS, Docker and... Windows Server 20...
Javier García Magna
 
Alex lakatos state of mobile web
Codecamp Romania
 
Matrix, The Year To Date, Ben Parsons, TADSummit 2018
Alan Quayle
 
Metarhia: Node.js Macht Frei
Timur Shemsedinov
 
Node.js architecture (EN)
Timur Shemsedinov
 
Hyperledger Fabric Update - June 2018
Arnaud Le Hors
 
20120306 dublin js
Richard Rodger
 
Open source building blocks for the Internet of Things - Jfokus 2013
Benjamin Cabé
 
XPDS14: OpenXT - Security and the Properties of a Xen Virtualisation Platform...
The Linux Foundation
 
John adams talk cloudy
John Adams
 
Cloud for Game Developers – Myth or Real Scenarios?
DevGAMM Conference
 
Vert.x introduction
GR8Conf
 
Summer 2017 undergraduate research powerpoint
Christopher Dubois
 
Debugging the Web with Fiddler
Ido Flatow
 
RPC in Smalltalk
ESUG
 
Exploring microservices in a Microsoft landscape
Alex Thissen
 
Chirp 2010: Scaling Twitter
John Adams
 
Be faster then rabbits
Vladislav Bauer
 
Cont0519
Samuel Dratwa
 
Ad

Recently uploaded (20)

PDF
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PDF
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PDF
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
PPTX
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
PDF
July Patch Tuesday
Ivanti
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PPTX
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PPT
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
July Patch Tuesday
Ivanti
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 

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 | [email protected] | @ebullientworks Play – http://game-on.org Learn more – http://book.game-on.org