liberty bikes
play

LIBERTY BIKES An online game for 1-4 players Built on microservices - PowerPoint PPT Presentation

LIBERTY BIKES An online game for 1-4 players Built on microservices What is Liberty Bikes? What is Liberty Bikes? Objective: be the last player alive Join a game by entering a code Bikes move at the same speed Each round


  1. LIBERTY BIKES An online game for 1-4 players Built on microservices

  2. What is Liberty Bikes?

  3. What is Liberty Bikes? • Objective: be the last player alive • Join a game by entering a code • Bikes move at the same speed • Each round lasts about 1 minute • Bikes leave a trail • Stats for each player are tracked across rounds • Players steer up/down/left/right • Play a few games, then come back later to see if you still hold • Hit any obstacle, trail, or player, the top spot and you’re out!

  4. Overall Design UI (Angular) Non-Java frontend Player Service Game Service (REST) (REST + websockets) Auth Service SSO providers DB (REST) (Google, Twitter, GitHub)

  5. Overall Design UI (Angular) CPU + I/O intensive Player Service Game Service (REST) (REST + websockets) Auth Service SSO providers DB (REST) (Google, Twitter, GitHub)

  6. Overall Design UI (Angular) Internal REST calls Player Service Game Service (REST) (REST + websockets) Auth Service SSO providers DB (REST) (Google, Twitter, GitHub)

  7. Overall Design UI (Angular) Persistent data Player Service Game Service (REST) (REST + websockets) Auth Service SSO providers DB (REST) (Google, Twitter, GitHub)

  8. Overall Design UI (Angular) External REST calls Player Service Game Service (REST) (REST + websockets) Auth Service SSO providers DB (REST) (Google, Twitter, GitHub)

  9. Overall Design UI (Angular) Single-Sign On auth Player Service Game Service (REST) (REST + websockets) Auth Service SSO providers DB (REST) (Google, Twitter, GitHub)

  10. Benefits of Microservices Architecture • Independently scale services UI (Angular) Player Service (REST + (REST + (REST) websockets) (REST + websockets) (REST + Game Service websockets) websockets) (REST + websockets) Auth Service SSO providers DB (REST)

  11. Benefits of Microservices Architecture • Independently scale services UI (Angular) • Develop services independently Game Service Player Service v1 (REST + (REST) websockets) Auth Service SSO providers DB (REST)

  12. Benefits of Microservices Architecture • Independently scale services UI (Angular) • Develop services independently Game Service • Continuous delivery/deployment Player Service (REST + (REST) websockets) Auth Service SSO providers DB (REST)

  13. Benefits of Microservices Architecture • Independently scale services UI (Angular) • Develop services independently Game Service • Continuous delivery/deployment Player Service (REST + (REST) websockets) • Language/framework freedom Auth Service SSO providers DB (REST)

  14. Benefits of Microservices Architecture • Independently scale services UI (Angular) • Develop services independently Game Service • Continuous delivery/deployment Player Service (REST + (REST) websockets) • Language/framework freedom Auth Service • Fault/security isolation SSO providers DB (REST)

  15. Difficulties of Microservices Architecture • Lots of service-service calls • MP Rest Client + JAX-RS • More points of failure • MP Fault Tolerance • Reconfigure for dev/prod • MP Config • Handling authentication • MP JWT

  16. The tech stack

  17. 8

  18. Configure required features Liberty server.xml includes the needed features

  19. Rest Client GET https://github.com/login/oauth/access_tokenclient_id=foo&client_secret=foo&…

  20. MicroProfile Rest Client GET https://github.com/ login/oauth/ access_token ?client_id=foo&client_secret=foo&… -Dorg.libertybikes.auth.service.github.GitHubOAuthAPI/mp-rest/url=https://github.com

  21. MicroProfile Fault Tolerance • @Retry • @Timeout 3x • @CircuitBreaker Game Service Player Service (REST + (REST) websockets) • @Fallback DB

  22. MicroProfile Config Optional Required $ export auth_url=https://production.com/auth-service Override $ export github_key=superSecret java.util.NoSuchElementException: CWMCG0015E: Validation The property foo was not found in the configuration

  23. JSON Web Tokens (JWT) { eyJhbGciOiJIUzI1NiI “alg”: “RS256”, header sInR5cCI6IkpXVCJ9. “typ”: “JWT” eyJzdWIiOiIxMjM0N } { TY3ODkwIiwibmFtZS “iss”: “libertybikes.com”, I6IkpvaG4gRG9lIiwia payload “sub”: “Andy”, ”groups”: [ “admin”, “user” ], WF0IjoxNTE2MjM5M … DIyfQ.VfiYwvArp2lN } V6UgpwgqrqfbJp9Q RS256( signature BASE64(header), pMdv07M8ZI4u4Vkw BASE64(payload), liFtz67lkDF8keyGciql secret)

  24. JSON Web Tokens (JWT) • Many different libs • Each supports different claims

  25. MicroProfile JWT BASIC CUSTOM

  26. MicroProfile OpenAPI

  27. Where To Get It You can play hosted Liberty Bikes here: (DE) libertybikes-frontend.eu-de.mybluemix.net (UK) libertybikes-frontend.eu-gb.mybluemix.net (US) libertybikes.mybluemix.net Or, clone our repository and run it locally: github.com/liberty-bikes/liberty-bikes

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend