Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Moving a production API from REST & Microservices to GraphQL

Moving a production API from REST & Microservices to GraphQL

GraphQL has many advantages over RESTful APIs. A lot of companies start thinking about migration paths for adopting GraphQL, which not only come with technological but also with organisational challenges!
Karol Wyszynski and Bogdan Nedelcu from Lokalleads (http://www.lokalleads.com/) will tell us about their adventure migrating a backend infrastructure composed of several microservices around a Java web application to GraphQL. Among other topics, they will talk about why (and when) GraphQL is a good choice, how exactly their migration was carried out and the effects it had for their team on a technological and organisational level.

Bogdan Nedelcu

October 17, 2017

More Decks by Bogdan Nedelcu

Other Decks in Technology


  1. About us 16.10.17 2 Karol Wyszynski Co-Founder & CTO [email protected]

    LinkedIn: www.linkedin.com/in/karol-wyszynski Bogdan Nedelcu Software-Developer [email protected]
  2. Lokalleads 16.10.17 4 B2B Service provider for craftsman with >

    800 customers - Real-time calculator for complex quotation - Lead channel tracking(phone, email, showrooms) - Online Marketing SaaS
  3. Lokalleads 16.10.17 5 Founded in 2013 - 35+ employees -

    8 applications - 7 developers - 4 programing languages
  4. The Journey to GraphQL 6 1. Why: Motivation 2. How:

    Transition 3. How: Challenges 4. What: Result
  5. Motivation – Legacy Infrastructure 16.10.17 8 Frontend Backend Frontend Backend

    Frontend Java Php Java Ruby Java ReactJS Frontend Frontend Frontend Backend Backend Backend
  6. Motivation - Legacy Application Stack 16.10.17 9 - Mostly MVC(Spring/Rails)

    with REST Endpoints - Server-Side rendered HTML with Ajax calls - One React JS Front End Client
  7. Motivation - Requirements 16.10.17 10 - Complex UI - Public

    API - Faster Development - Reduce integration effort - Reduce project onboarding - Performance
  8. Motivation - Solutions? 16.10.17 11 Complex UI - Experience with

    React.JS for over a year - Future Implementation in most of the clients - Developer team React knowledge
  9. Motivation - Solutions? 16.10.17 12 Public API - Pure REST

    standard is hard to implement - Unique URI´s, request methods has to have a meaning(PUT or POST?) - Need a Gateway for security and performance /product or /products PUT or POST which Content-Type ?
  10. Motivation - Solutions? 16.10.17 14 Faster Development - Parallelize front-end

    and backend development - Communication and Transparency
  11. Motivation – Solution 16.10.17 16 Frontend Java Frontend Php Frontend

    Frontend Frontend Frontend Java Ruby Node GraphQL API Node
  12. Motivation – Technical Risk 16.10.17 17 Non industrial Standard API

    • Fastest growing community • Strong reference implementation by Facebook
  13. Motivation – Technical Risk 16.10.17 18 Lack of experience -

    Hired Professional Support for inital setup - Team Training
  14. Transition: Incremental Adoption 06.07.17 lokalleads 22 lokalleads Frontend Backend Frontend

    Backend Frontend Backend Frontend Backend Frontend Backend GraphQL Frontend Backend
  15. Transition: Client App Based 06.07.17 lokalleads 23 lokalleads Frontend Backend

    Frontend Backend Frontend Backend Frontend Backend Frontend Backend Frontend Backend GraphQL
  16. Transition: Client Requirements 06.07.17 lokalleads 24 lokalleads - Concurrent request

    - Different data sources - Reactive: On user action more requests
  17. Transition: GraphQL Schema Prefer building a Graph-QL schema that describes

    how clients use the data, rather than mirroring the legacy database schema.
  18. Transition: Client App Based View 1 View 1 View 1

    View 1 View 1 GraphQL Server Resolver2 Resolver 2 Resolver1
  19. Challenges: Thinking in Graphs 06.07.17 lokalleads 37 In the REST

    implementation data is modeled in terms of network services. /campaigns /campaigns_and_metrics /campaigns_and_statistics
  20. Challenges: Thinking in Graphs 06.07.17 lokalleads 38 With GraphQL, you

    model your business domain as a graph. /campaigns /campaigns_and_metrics /campaigns_and_statistics
  21. Challenges - Schema Agreement 06.07.17 lokalleads 41 - Development starts

    with the Schema - Hard types force the team to agree before hand