SlideShare a Scribd company logo
1 of 64
DocplannerTech
GraphQL - hot or not?
How to simplify
API based services?
DocplannerTech
Adam Klimczyk
g.aklimczyk@gmail.com
❖ Docplanner group since 2016
❖ Revenue team member
❖ Fan of simple, pragmatic solutions
DocplannerTech
Agenda
DocplannerTech
Introduction
❖ what is it?
❖ who designed and developed it?
❖ REST vs GraphQL
❖ requests and responses
❖ what issues does it solve?
❖ key features
❖ benefits
DocplannerTech
Weaknesses
&
Advantages
❖ benefits:
consistency, atomicity, easier
batching, type hinting, rapid
development, self-documenting
introspection query
❖ differences:
HTTP caching inefficiency,
different approach for
performance tracking, different
quota management, thinking in
graphs, parallelism
DocplannerTech
Was it worth it?
DocplannerTech
CRM
Centralization of CRM system aggregating functionalities
of two different systems e.g. products, contracts
management
DocplannerTech
and other common parts
❖ booking appointments
❖ Q&A
❖ marketplace
❖ etc.
DocplannerTech
CRM application
❖ managing products/services
❖ using legacy APIs
❖ designed to be fast and
reliable
❖ search engine
❖ need of rapid development
DocplannerTech
CRM application
SSO
❖ JMS
❖ FOS Rest
Bundle
PHP implementation
SF4
SPA
❖ Sf4 proxy app
❖ database agnostic
microservice
❖ front-end based on Vue.js
❖ SPA
❖ authorized by SSO
REST API /api/v3
auth
CRM
DocplannerTech
How it happened
story time - the need came
DocplannerTech
CRM application
front
guy
I need endpoint, that will provide info about
customers, invoices, doctors and facilities
Ok, I will do itme
DocplannerTech
CRM application
front
guy
I want to use same search but now only
with doctors and facilities
Ok, then we can add an additional query
parameter `type`me
DocplannerTech
CRM application
front
guy
I need to also show addresses and
specializations if it’s a doctor/facility.
I can do it with a YAML configuration, some tags, and
resolvers and we’re doneme
DocplannerTech
CRM application
front
guy
I need an endpoint with doctor/facility, with address,
specialization, address should provide info about a
contract entity, and also products related with this
doctor/facility
ok, but then I will give 7 endpoints make 42 calls and
aggregate your data
me
DocplannerTech
Let’s take a break
story time - the need came
DocplannerTech
Why not to use GraphQL ?
I heard about it some time ago...
DocplannerTech
❖ created as a data-fetching API
❖ developed in 2012 released in 2015
by Facebook
❖ mobile apps friendly
❖ cure against complexity
❖ JSON-like queries, JSON
responses
❖ communication over HTTP
Introduction
DocplannerTech
Introduction
❖ single endpoint instead of
many
❖ ask for what you need, get
exactly that
❖ get many resources in a
single request
❖ describe what’s possible
with a type system
❖ evolve your API without
versionshttps://dev-blog.apollodata.com/graphql-vs-rest-5d425123e34b
DocplannerTech
Introduction
1 2
4
1 Query name
2
Arguments, for example:
scalar types, lists of
constants
3
Single node can be of
multiple types
4
Using inline fragments to
differentiate result data
❖ You can ask for different
data of different types
3
DocplannerTech
Introduction
1
2
3
4
1 Result container object
2 Property with union results
3 Doctor Type entity
4 Facility Type entity
❖ Response keys aligned with
request keys
DocplannerTech
We know how to GET
but how do we POST, PUT, DELETE
DocplannerTech
Mutations
to the rescue!
http://toma-mais-uma.blogspot.com/2015/01/quasimodo-cervero-e-preso-no-galeao-ao.html
DocplannerTech
Introduction
❖ custom operation on data
❖ can return modified data
❖ can use variables
❖ batch mutations by array of
arguments
DocplannerTech
Benefits
DocplannerTech
Benefits
❖ GraphiQL tool
❖ strict types and required
operator `!`
❖ static validation
❖ granulation and consistency
❖ self-documenting
DocplannerTech
Benefits
❖ introspection query
❖ information about schema
❖ information about types
❖ can receive info even about
nested nodes
❖ complex documentation
DocplannerTech
Benefits
❖ better code arrangement
❖ entity is defined in one
place
❖ more readable
❖ more natural way to define
relations
DocplannerTech
Benefits
❖ one endpoint istead a ton of
❖ no maintenance in proxy
app
❖ simpler
❖ duplication removed
DocplannerTech
Benefits
❖ can integrate data sources from various
systems
❖ possibility of using parallel processing
❖ language/db standalone
❖ can handle authorization with many APIs
https://www.howtographql.com/basics/3-big-picture/
DocplannerTech
Why not to use GraphQL ?
a proof of concept
DocplannerTech
Proof of concept
❖ expression language
❖ configured by YAML
❖ works with objects
❖ data-source standalone
❖ low entry level + community
❖ solid but laconic documentation
❖ many integrations
DocplannerTech
Proof of concept
SSO
overblog/GraphQLBundle
PHP implementation
SF4
SPA
GraphQL API
/api/graphql
3 New CRM microservice
4 Sf4 working as a proxy
5 Vue.js SPA app
1
REST API /api/v3
5
4
3
auth
2
+
1 legacy app
GraphQL service2
CRM
auth
DocplannerTech
After a break
story time - the solution came
DocplannerTech
Proof of concept
We’ll use GraphQL and it will be just ONE ENDPOINT !!!me
front
guy
I need an endpoint with doctor/facility, with address,
specialization, address should provide info about a
contract entity, and also products related with this
doctor/facility
DocplannerTech
Proof of concept
2
5
2
convention, can be also
introspection `__type`
3 value variable - entity object
1
3 4
4
info variable containing e.g.
fieldName
1
configuration of Doctor
entity
5
custom field resolver - when
property not present in
object
DocplannerTech
Proof of concept
2
3
1
4
4
exception when behaviour not
implemented
1 value variable - entity object
3
property that’s not present in object,
resolved on demand
2
info variable containing e.g.
fieldName
❖ property resolver
DocplannerTech
Proof of concept
❖ silly simple
❖ atomic
❖ can return an object
DocplannerTech
Proof of concept
❖ simple query atomic query
❖ response data aligned with request
❖ response contains selected subset
of data
❖ Give me a doctor with id: 12456
DocplannerTech
Proof of concept
1 search query1
4
2
2
entity containing search
result with additional info
e.g. score
3 list of constant values
3
4
entity containing union of
different search objects
DocplannerTech
Proof of concept
2
type resolver service from
expression language
1
2
1 union types list
2
❖ union needs type resolver
DocplannerTech
After some time
DocplannerTech
Proof of concept
❖ dedicated resolvers for
related graph nodes
❖ easy to read and extend
❖ property dispatched only
when necessary
❖ Doctor entity with relations and their resolvers
DocplannerTech
Proof of concept
❖ Amount of queries depends from resolved object/properties count
❖ Performance issues because of lot of atomic queries. (Overhead)
❖ How to reduce it ?
❖ N + 1 issue representation
DocplannerTech
N + 1 - issue
❖ Creates overhead on communication
with database
❖ Can be solved by batching
❖ Usually caused by bad design
DocplannerTech
N + 1 - way to solve
Object 1 Object 2
Entity 1 Entity 2
Type A Type B
❖ Requests for resources of
same type can be resolved
with one query
❖ Load reducement
Type CType C
Entity 1, Entity 2
fetched in
single query
❖ Queries can be batched
DocplannerTech
Proof of concept
❖ a lot of atomic queries
❖ huge overhead
❖ ~5,3 sec in controller
❖ ~2,5 sec in of queries
❖ batched queries
❖ reduced overhead
❖ ~1,3 sec in controller
❖ ~0,7 sec on queries
❖ with batching❖ without batching
DocplannerTech
Proof of concept
❖ simple idea
❖ allow to resolve bunch of requests
instead of single query
❖ easy installation and configuration
❖ uses promise adapter
DocplannerTech
Proof of concept
❖ replaces immediate atomic query
with deferred load
❖ allows to use ORM populate
functionalities
❖ minimalistic resolvers
DocplannerTech
Proof of concept
❖ declared in configuration
❖ service alias
❖ promise adapter can be
replaced
DocplannerTech
Proof of concept
❖ Almost 4x faster in query times
❖ Almost 5x less in queries count
DocplannerTech
Performance
fixed
DocplannerTech
Issues?
DocplannerTech
Issues
❖ query complexity needs to be measured other way
❖ inefficient HTTP cache (different payload)
❖ versioning add-only
❖ painful relation changes
❖ bestpractices says mark as @deprecated
❖ DoS - resource exhaustion
❖ some manual work probably required
❖ application cache is more important
DocplannerTech
- Using GraphQL endpoints is amazing. I can create request for a lot of data at once
- And what did you received
- A timeout exception
about using GitHub GraphQL Api
Quote about GraphQL performance
DocplannerTech
❖ query complexity analysis
❖ limiting query depth
❖ using relay connection, and relay pagination
helper
What we can to reduce risk of
timeout/resources exhaustion?
DocplannerTech
Issues
❖ defining complexity weight for object
❖ additional work
❖ needs to be maintained
❖ query complexity analysis
❖ hard to find silver bullet
DocplannerTech
Issues
❖ limited usability
❖ to general
❖ limiting query depth
❖ base protection
❖ protects against DoS
DocplannerTech
Issues
❖ consistent and powerful
❖ ability to set limit
❖ cursor based
❖ using Relay connection, and relay pagination helper
❖ more code to write
❖ can be used with promises
❖ complexity increase
DocplannerTech
Summary
- inefficient HTTP cache
+ consistent and powerful
+ atomic and clear
+ resolvers and data-loaders
+ can boost up API development
+ stable definitions and self-documenting
- DoS protection needed
-
different than in REST each
endpoint is `connected`
+ single endpoint
- resource consumption
- load balance issue
- painful structure changes
- endpoint can be heavy
+ no versioning
+ data customization
+ property resolve on demand
- performance tracking
DocplannerTech
Yes, it was worth it!
DocplannerTech
Sure
In my opinion it’s great,
for internal services communication
DocplannerTech
and even GitHub
migrates to GraphQL API
(v4)
DocplannerTech
Thanks

More Related Content

What's hot

Scalable database, Scalable language @ JDC 2013
Scalable database, Scalable language @ JDC 2013Scalable database, Scalable language @ JDC 2013
Scalable database, Scalable language @ JDC 2013Maciek Próchniak
 
What's new in Kibana - Elastic meetup
What's new in Kibana - Elastic meetupWhat's new in Kibana - Elastic meetup
What's new in Kibana - Elastic meetupUllyCarolinneSampaio
 
Kotlin REST & GraphQL API
Kotlin REST & GraphQL APIKotlin REST & GraphQL API
Kotlin REST & GraphQL APISean O'Brien
 
Graphql presentation
Graphql presentationGraphql presentation
Graphql presentationVibhor Grover
 
Introduction to GraphQL
Introduction to GraphQLIntroduction to GraphQL
Introduction to GraphQLRodrigo Prates
 
GraphQL as an alternative approach to REST (as presented at Java2Days/CodeMon...
GraphQL as an alternative approach to REST (as presented at Java2Days/CodeMon...GraphQL as an alternative approach to REST (as presented at Java2Days/CodeMon...
GraphQL as an alternative approach to REST (as presented at Java2Days/CodeMon...luisw19
 
Introduction to Datasource V2 API
Introduction to Datasource V2 APIIntroduction to Datasource V2 API
Introduction to Datasource V2 APIdatamantra
 
GraphQL Munich Meetup #1 - How We Use GraphQL At Commercetools
GraphQL Munich Meetup #1 - How We Use GraphQL At CommercetoolsGraphQL Munich Meetup #1 - How We Use GraphQL At Commercetools
GraphQL Munich Meetup #1 - How We Use GraphQL At CommercetoolsNicola Molinari
 
GraphQL: Enabling a new generation of API developer tools
GraphQL: Enabling a new generation of API developer toolsGraphQL: Enabling a new generation of API developer tools
GraphQL: Enabling a new generation of API developer toolsSashko Stubailo
 
DocOps — The Analytical Window to Your Customer’s Experience with Wade Clements
DocOps — The Analytical Window to Your Customer’s Experience with Wade ClementsDocOps — The Analytical Window to Your Customer’s Experience with Wade Clements
DocOps — The Analytical Window to Your Customer’s Experience with Wade ClementsInformation Development World
 
Java Day Istanbul 2018 GraphQL vs Traditional REST API
Java Day Istanbul 2018 GraphQL vs Traditional REST APIJava Day Istanbul 2018 GraphQL vs Traditional REST API
Java Day Istanbul 2018 GraphQL vs Traditional REST APIVladimir Dejanovic
 
GraphQL - The new "Lingua Franca" for API-Development
GraphQL - The new "Lingua Franca" for API-DevelopmentGraphQL - The new "Lingua Franca" for API-Development
GraphQL - The new "Lingua Franca" for API-Developmentjexp
 
Understanding transactional writes in datasource v2
Understanding transactional writes in  datasource v2Understanding transactional writes in  datasource v2
Understanding transactional writes in datasource v2datamantra
 
Apache Airflow in the Cloud: Programmatically orchestrating workloads with Py...
Apache Airflow in the Cloud: Programmatically orchestrating workloads with Py...Apache Airflow in the Cloud: Programmatically orchestrating workloads with Py...
Apache Airflow in the Cloud: Programmatically orchestrating workloads with Py...Kaxil Naik
 
REST vs GraphQL
REST vs GraphQLREST vs GraphQL
REST vs GraphQLSquareboat
 
Coldfusion
ColdfusionColdfusion
ColdfusionRam
 
A Graph Database That Scales - ArangoDB 3.7 Release Webinar
A Graph Database That Scales - ArangoDB 3.7 Release WebinarA Graph Database That Scales - ArangoDB 3.7 Release Webinar
A Graph Database That Scales - ArangoDB 3.7 Release WebinarArangoDB Database
 

What's hot (20)

Scalable database, Scalable language @ JDC 2013
Scalable database, Scalable language @ JDC 2013Scalable database, Scalable language @ JDC 2013
Scalable database, Scalable language @ JDC 2013
 
What's new in Kibana - Elastic meetup
What's new in Kibana - Elastic meetupWhat's new in Kibana - Elastic meetup
What's new in Kibana - Elastic meetup
 
GraphQL Europe Recap
GraphQL Europe RecapGraphQL Europe Recap
GraphQL Europe Recap
 
Kotlin REST & GraphQL API
Kotlin REST & GraphQL APIKotlin REST & GraphQL API
Kotlin REST & GraphQL API
 
Graphql presentation
Graphql presentationGraphql presentation
Graphql presentation
 
Introduction to GraphQL
Introduction to GraphQLIntroduction to GraphQL
Introduction to GraphQL
 
GraphQL as an alternative approach to REST (as presented at Java2Days/CodeMon...
GraphQL as an alternative approach to REST (as presented at Java2Days/CodeMon...GraphQL as an alternative approach to REST (as presented at Java2Days/CodeMon...
GraphQL as an alternative approach to REST (as presented at Java2Days/CodeMon...
 
Introduction to Datasource V2 API
Introduction to Datasource V2 APIIntroduction to Datasource V2 API
Introduction to Datasource V2 API
 
GraphQL Munich Meetup #1 - How We Use GraphQL At Commercetools
GraphQL Munich Meetup #1 - How We Use GraphQL At CommercetoolsGraphQL Munich Meetup #1 - How We Use GraphQL At Commercetools
GraphQL Munich Meetup #1 - How We Use GraphQL At Commercetools
 
Introduction to GraphQL
Introduction to GraphQLIntroduction to GraphQL
Introduction to GraphQL
 
GraphQL: Enabling a new generation of API developer tools
GraphQL: Enabling a new generation of API developer toolsGraphQL: Enabling a new generation of API developer tools
GraphQL: Enabling a new generation of API developer tools
 
DocOps — The Analytical Window to Your Customer’s Experience with Wade Clements
DocOps — The Analytical Window to Your Customer’s Experience with Wade ClementsDocOps — The Analytical Window to Your Customer’s Experience with Wade Clements
DocOps — The Analytical Window to Your Customer’s Experience with Wade Clements
 
Java Day Istanbul 2018 GraphQL vs Traditional REST API
Java Day Istanbul 2018 GraphQL vs Traditional REST APIJava Day Istanbul 2018 GraphQL vs Traditional REST API
Java Day Istanbul 2018 GraphQL vs Traditional REST API
 
GraphQL - The new "Lingua Franca" for API-Development
GraphQL - The new "Lingua Franca" for API-DevelopmentGraphQL - The new "Lingua Franca" for API-Development
GraphQL - The new "Lingua Franca" for API-Development
 
Understanding transactional writes in datasource v2
Understanding transactional writes in  datasource v2Understanding transactional writes in  datasource v2
Understanding transactional writes in datasource v2
 
Apache Airflow in the Cloud: Programmatically orchestrating workloads with Py...
Apache Airflow in the Cloud: Programmatically orchestrating workloads with Py...Apache Airflow in the Cloud: Programmatically orchestrating workloads with Py...
Apache Airflow in the Cloud: Programmatically orchestrating workloads with Py...
 
Intro to GraphQL
 Intro to GraphQL Intro to GraphQL
Intro to GraphQL
 
REST vs GraphQL
REST vs GraphQLREST vs GraphQL
REST vs GraphQL
 
Coldfusion
ColdfusionColdfusion
Coldfusion
 
A Graph Database That Scales - ArangoDB 3.7 Release Webinar
A Graph Database That Scales - ArangoDB 3.7 Release WebinarA Graph Database That Scales - ArangoDB 3.7 Release Webinar
A Graph Database That Scales - ArangoDB 3.7 Release Webinar
 

Similar to GraphQL - hot or not? How to simplify API based services?

gRPC, GraphQL, REST - Which API Tech to use - API Conference Berlin oct 20
gRPC, GraphQL, REST - Which API Tech to use - API Conference Berlin oct 20gRPC, GraphQL, REST - Which API Tech to use - API Conference Berlin oct 20
gRPC, GraphQL, REST - Which API Tech to use - API Conference Berlin oct 20Phil Wilkins
 
Building scalable data with kafka and spark
Building scalable data with kafka and sparkBuilding scalable data with kafka and spark
Building scalable data with kafka and sparkbabatunde ekemode
 
GraphQL-ify your APIs - Devoxx UK 2021
 GraphQL-ify your APIs - Devoxx UK 2021 GraphQL-ify your APIs - Devoxx UK 2021
GraphQL-ify your APIs - Devoxx UK 2021Soham Dasgupta
 
GraphQL is actually rest
GraphQL is actually restGraphQL is actually rest
GraphQL is actually restJakub Riedl
 
PHP South Coast - Don't code bake, an introduction to CakePHP 3
PHP South Coast - Don't code bake, an introduction to CakePHP 3PHP South Coast - Don't code bake, an introduction to CakePHP 3
PHP South Coast - Don't code bake, an introduction to CakePHP 3David Yell
 
Traveloka's data journey — Traveloka data meetup #2
Traveloka's data journey — Traveloka data meetup #2Traveloka's data journey — Traveloka data meetup #2
Traveloka's data journey — Traveloka data meetup #2Traveloka
 
From Rails legacy to DDD - Pivorak, Lviv
From Rails legacy to DDD - Pivorak, LvivFrom Rails legacy to DDD - Pivorak, Lviv
From Rails legacy to DDD - Pivorak, LvivAndrzej Krzywda
 
Roundtable_-_API_Research__Testing_Tools.pdf
Roundtable_-_API_Research__Testing_Tools.pdfRoundtable_-_API_Research__Testing_Tools.pdf
Roundtable_-_API_Research__Testing_Tools.pdfMostafa Higazy
 
REST in Peace. Long live gRPC!
REST in Peace. Long live gRPC! REST in Peace. Long live gRPC!
REST in Peace. Long live gRPC! QAware GmbH
 
Microservices: Benefits, drawbacks and are they for me?
Microservices: Benefits, drawbacks and are they for me?Microservices: Benefits, drawbacks and are they for me?
Microservices: Benefits, drawbacks and are they for me?Marian Marinov
 
Next Gen Data Modeling in the Open Data Platform With Doron Porat and Liran Y...
Next Gen Data Modeling in the Open Data Platform With Doron Porat and Liran Y...Next Gen Data Modeling in the Open Data Platform With Doron Porat and Liran Y...
Next Gen Data Modeling in the Open Data Platform With Doron Porat and Liran Y...HostedbyConfluent
 
PiterPy 2016: Parallelization, Aggregation and Validation of API in Python
PiterPy 2016: Parallelization, Aggregation and Validation of API in PythonPiterPy 2016: Parallelization, Aggregation and Validation of API in Python
PiterPy 2016: Parallelization, Aggregation and Validation of API in PythonMax Klymyshyn
 
apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...
apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...
apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...apidays
 
A RESTful introduction
A RESTful introductionA RESTful introduction
A RESTful introductionDaniel Toader
 
GraphQL vs. (the) REST
GraphQL vs. (the) RESTGraphQL vs. (the) REST
GraphQL vs. (the) RESTcoliquio GmbH
 
Navigating SAP’s Integration Options (Mastering SAP Technologies 2013)
Navigating SAP’s Integration Options (Mastering SAP Technologies 2013)Navigating SAP’s Integration Options (Mastering SAP Technologies 2013)
Navigating SAP’s Integration Options (Mastering SAP Technologies 2013)Sascha Wenninger
 
Building and deploying LLM applications with Apache Airflow
Building and deploying LLM applications with Apache AirflowBuilding and deploying LLM applications with Apache Airflow
Building and deploying LLM applications with Apache AirflowKaxil Naik
 
Design Web Service API by HungerStation
Design Web Service API by HungerStationDesign Web Service API by HungerStation
Design Web Service API by HungerStationArabNet ME
 

Similar to GraphQL - hot or not? How to simplify API based services? (20)

gRPC, GraphQL, REST - Which API Tech to use - API Conference Berlin oct 20
gRPC, GraphQL, REST - Which API Tech to use - API Conference Berlin oct 20gRPC, GraphQL, REST - Which API Tech to use - API Conference Berlin oct 20
gRPC, GraphQL, REST - Which API Tech to use - API Conference Berlin oct 20
 
Building scalable data with kafka and spark
Building scalable data with kafka and sparkBuilding scalable data with kafka and spark
Building scalable data with kafka and spark
 
GraphQL-ify your APIs - Devoxx UK 2021
 GraphQL-ify your APIs - Devoxx UK 2021 GraphQL-ify your APIs - Devoxx UK 2021
GraphQL-ify your APIs - Devoxx UK 2021
 
GraphQL is actually rest
GraphQL is actually restGraphQL is actually rest
GraphQL is actually rest
 
PHP South Coast - Don't code bake, an introduction to CakePHP 3
PHP South Coast - Don't code bake, an introduction to CakePHP 3PHP South Coast - Don't code bake, an introduction to CakePHP 3
PHP South Coast - Don't code bake, an introduction to CakePHP 3
 
Traveloka's data journey — Traveloka data meetup #2
Traveloka's data journey — Traveloka data meetup #2Traveloka's data journey — Traveloka data meetup #2
Traveloka's data journey — Traveloka data meetup #2
 
From Rails legacy to DDD - Pivorak, Lviv
From Rails legacy to DDD - Pivorak, LvivFrom Rails legacy to DDD - Pivorak, Lviv
From Rails legacy to DDD - Pivorak, Lviv
 
Roundtable_-_API_Research__Testing_Tools.pdf
Roundtable_-_API_Research__Testing_Tools.pdfRoundtable_-_API_Research__Testing_Tools.pdf
Roundtable_-_API_Research__Testing_Tools.pdf
 
REST in Peace. Long live gRPC!
REST in Peace. Long live gRPC! REST in Peace. Long live gRPC!
REST in Peace. Long live gRPC!
 
Microservices: Benefits, drawbacks and are they for me?
Microservices: Benefits, drawbacks and are they for me?Microservices: Benefits, drawbacks and are they for me?
Microservices: Benefits, drawbacks and are they for me?
 
Jones "Working with Scholarly APIs: A NISO Training Series, Session One: Foun...
Jones "Working with Scholarly APIs: A NISO Training Series, Session One: Foun...Jones "Working with Scholarly APIs: A NISO Training Series, Session One: Foun...
Jones "Working with Scholarly APIs: A NISO Training Series, Session One: Foun...
 
Next Gen Data Modeling in the Open Data Platform With Doron Porat and Liran Y...
Next Gen Data Modeling in the Open Data Platform With Doron Porat and Liran Y...Next Gen Data Modeling in the Open Data Platform With Doron Porat and Liran Y...
Next Gen Data Modeling in the Open Data Platform With Doron Porat and Liran Y...
 
PiterPy 2016: Parallelization, Aggregation and Validation of API in Python
PiterPy 2016: Parallelization, Aggregation and Validation of API in PythonPiterPy 2016: Parallelization, Aggregation and Validation of API in Python
PiterPy 2016: Parallelization, Aggregation and Validation of API in Python
 
apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...
apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...
apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...
 
A RESTful introduction
A RESTful introductionA RESTful introduction
A RESTful introduction
 
GraphQL vs. (the) REST
GraphQL vs. (the) RESTGraphQL vs. (the) REST
GraphQL vs. (the) REST
 
Navigating SAP’s Integration Options (Mastering SAP Technologies 2013)
Navigating SAP’s Integration Options (Mastering SAP Technologies 2013)Navigating SAP’s Integration Options (Mastering SAP Technologies 2013)
Navigating SAP’s Integration Options (Mastering SAP Technologies 2013)
 
Building and deploying LLM applications with Apache Airflow
Building and deploying LLM applications with Apache AirflowBuilding and deploying LLM applications with Apache Airflow
Building and deploying LLM applications with Apache Airflow
 
Design Web Service API by HungerStation
Design Web Service API by HungerStationDesign Web Service API by HungerStation
Design Web Service API by HungerStation
 
Fyp saufi
Fyp saufiFyp saufi
Fyp saufi
 

Recently uploaded

Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....kzayra69
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 

Recently uploaded (20)

Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 

GraphQL - hot or not? How to simplify API based services?

Editor's Notes

  1. This is today’s presentation topic, for those that hear this name for for the first time, don’t worry we will describe what it is actually and how it works
  2. So as I mentioned my name is Adam Klimczyk, I work in docplanner group since 2016, I’m a member of revenue team, we handle mostly backoffice stuff, like crm, managing products, invoicing and many others. What i like in programing are simple and pragmatic solutions. I hate to repeat same simple boring activities. I’m a fun of service oriented architecture and encapsulation that you can achieve with it. …
  3. We don’t want to lose any second. So let’s quickly start with the agenda.
  4. After defining our needs and issues , we will start with a small introduction and we tell ourself about when who and why invented and developed GraphQL
  5. After defining our needs and issues , we will start with a small introduction and we tell ourself about when who and why invented and developed GraphQL
  6. Presentation which is constructed the right way, should have a thesis that’s is actually a question. So let’s do some small change to get it. Instead of asking how to do it. Let’s ask … if i just should do it
  7. As I said I work in a revenue team, we handle most of backoffice stuff as well. Monolith-app mentioned in last slide is our legacy system, containing most out our CRM services by far. In our company we want to put effort to separate it as fast as we can, however without doing silly stuff. We don’t wanna do it at any cost, our approach is to do it step by step when there’s a need and possibility. Some time ago ZnanyLekarz company connected with Doctoralia Group, similar website/service. A big player in south america, spain and many other countries. After some time decision came, that written in php Docplanner code will merge country after country marketplace from Doctoralia. In our system we had to write all missing functionalities. It’s a big challenge, but as well a good opportunity to rewrite parts of code, and separate it well. So we decided to build a new microservice called HAYS.
  8. Probably all of you heard about DocPlanner or maybe more common name in will be Poland ZnanyLekarz. From patient’s perspective we help people to find best doctors, we deliver opinions, Q&A’s, you can book using online calendars as well. From doctor’s perspective we deliver them patients, and creates a place where they can be recognized as a specialist. We offer them a set of various products.
  9. Here we have some teaser form it, first functionality that is very important for our customer success / sales department is easy access to data. We also need to provide products, sale and deal management. We designed it on top of existing services, wanted to make it fast and reliable source of data
  10. Hays app is written in PHP, using symfony 4 it works as a proxy in communication with monolithic application. App is database agnostic and uses only API to fetch data Frontend is build with vue.js as a single page application. Data is cached with vue as well, so can work partially in offline mode To authorize and authenticate users we use single sign on service. So far we used standard approach with fos rest bundle and JMS serializing representations.
  11. So we reached moment when my adventure started
  12. As i mentioned main functionality is finding informations, We use elasticsearch as an engine for search based on some basic properties We needed an endpoint that will provide basic data for search results, details will be fetched later separately, It was quite clear and obvious
  13. But then another case appeared during autocomplete functionality for products management. We had a field for selecting facility/doctor entity that you want to assign some product to. So we limited it simply by adding an additional query parameter and a layer of type in service It was fast and easy
  14. For identification reasons we needed addresses and specialization entities related with this doctor/facility It was a little bit more complex, needed to extend representation, create some resolvers for properties (because I wanted to preserve ability to add next stuff for this option). But using abstract class, resolver, tags and factory it succeeded
  15. After search we needed to fetch details of doctor/facility but related to products and business logic related stuff. System started to be more, and more complex, and that was a moment to rethink our strategy. we had a Feeling that we started to have technical dept and adding new functionalities is will be harder each time. So we decided to find something that will allow us to reduce code complexity and duplication.
  16. Let’s stop at this point and come back to our presentation main topic
  17. Other team worked on they Go lang app, I heard that they started to implement it using graphQL, I decided to dive deep into it and check if it’s worth to go this way
  18. What graphQL is ? GraphQL is a data fetching API. So using another words, it means that’s something that gives you a new way, to use your old services, to provide a consistent, collective, and working on-demand data source. It was developed by Facebook as a hub of data for they mobile apps. The main reason was that they wanted to provide easy to use and flexible tool, and handle with an issue of increasing complexity.. So they developed it and then started to build a community around it, it succeeded and nowadays it’s a technology that is at least considered as a REST API alternative
  19. repeating what creators say: GraphQL is a query language, it allows you to take control over data that you receive, you can decide how your response should look like, it’s limited to entry points that was designed, but you can use Graph advantage here, freely nesting objects You can receive different object types info in one request, From the begining you know what is possible and what’s not
  20. How does some entry point query look like, it’s composed from query name , we can add arguments, that can be scalars or lists of constants like here, you can have also an object as an argument. Here we have object which is an union object. To differentiate properties called on various types of union object we can use three dots operator name of it
  21. As we can see we received response aligned to our query, we have search result preserving array of union objects, in this example doctors and facilites
  22. Because atomic, and higly customizable api was something that we wanted, and because it was 3 years since release date I’ve decided to realise a proof of concept to see if it can solve my issues.
  23. Because atomic, and higly customizable api was something that we wanted, and because it was 3 years since release date I’ve decided to realise a proof of concept to see if it can solve my issues.
  24. repeating what creators say: GraphQL is a query language, it allows you to take control over data that you receive, you can decide how your response should look like, it’s limited to entry points that was designed, but you can use Graph advantage here, freely nesting objects You can receive different object types info in one request, From the begining you know what is possible and what’s not
  25. Qool thing about grapQL is that’s described in atomic, precisive way. We can use standard types that allows us to describe reality well. Main benefit from that approach is that we have static validation. We don’t need to create documentation as it came from schema itself
  26. Qool thing about grapQL is that’s described in atomic, precisive way. We can use standard types that allows us to describe reality well. Main benefit from that approach is that we have static validation. We don’t need to create documentation as it came from schema itself
  27. Qool thing about grapQL is that’s described in atomic, precisive way. We can use standard types that allows us to describe reality well. Main benefit from that approach is that we have static validation. We don’t need to create documentation as it came from schema itself
  28. Qool thing about grapQL is that’s described in atomic, precisive way. We can use standard types that allows us to describe reality well. Main benefit from that approach is that we have static validation. We don’t need to create documentation as it came from schema itself
  29. As I mentioned it’s a data-fetching API, It can work as a some kind of proxy for your resources. Endpoint users can be unaware about your structure, it gives opportunity to create consistent and well defined datasource, You can also use and advantage of parallel resource request
  30. Because atomic, and higly customizable api was something that we wanted, and because it was 3 years since release date I’ve decided to realise a proof of concept to see if it can solve my issues.
  31. So i’ve implemented as an alternative to REST API It’s just one endpoint.
  32. There we‘re we can continue our story
  33. it will be realised with one endpoint universal entities work on front-end side
  34. property resolver example
  35. simplest atomic resolver
  36. first endpoint
  37. realisation of search endpoint that was requested
  38. union type, and type resolver
  39. Beca
  40. Because atomic, and higly customizable api was something that we wanted, and because it was 3 years since release date I’ve decided to realise a proof of concept to see if it can solve my issues.
  41. We cannot forget about potential issues that we can find out, and strategies that will allow to solve it
  42. as long as it’s simple endpoint it’s harder to track it app monitors like new relic, you can still track queries, but you can miss information about how end users uses your API Each request can be different, so caching requests is much harder, you can cache it on some application level still GraphQL isn’t designed to be versioned, it’s something nice, but you need to maintain previous fields, you can at least mark them as @deprecated. AKA Denial of Service attacks DoS ---> resource exhaustion risk, but we have some tools to protect against it
  43. Presentation which is constructed the right way, should have a thesis that’s is actually a question. So let’s do some small change to get it. Instead of asking how to do it. Let’s ask … if i just should do it
  44. Because atomic, and higly customizable api was something that we wanted, and because it was 3 years since release date I’ve decided to realise a proof of concept to see if it can solve my issues.