JavaFest. Cedrick Lunven. Build APIS with SpringBoot - REST, GRPC, GRAPHQL which one should you pick?

F
FestGroupFestGroup
switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020
Cedrick Lunven | Director of Developer Advocacy #DataStax @clunven
Build APIS with
SpringBoot
REST, GRPC, GRAPHQL
Which one should you
pick?
switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020
About me: Cedrick Lunven
Director of Developer Advocacy
Creator and Maintainer of FF4j
Java and Spring Dinosaur
switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020
Agenda
50min
2
3 DEMO and Code Browse
Data Model & Persistence with Apache Cassandra
1 Anatomy of a Spring Boot Micro service
4 Decision tree
5 Take my code and slides + Q&A
switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020
NEW PROFESSIONAL
JAVA EVENT
MAY 30th, 2020
KYIV, UKRAINE
Cedrick Lunven | Director of Developer Advocacy #DataStax @clunven
Anatomy of a Spring Boot Microservice
1
switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020
Monolithic
Business Logic
User Interface
Data Interface
Multichannel
UI Mobile UI Web
ESB
SOA
Specialization
BUS
S1 S2 S3 Sn
RDBMS
noSQL
DataLake
Micro
Frontend
All Things Distributed
Web Components SPA Native
BFF (Backend for Frontend)
Micro
Services
Data Mesh
Api Gateway Service Discovery
RDBMS Graph Hadoop
Document KV newSQLColumn
TSDB
Distributed Tracing
Containerization
Layers
Business Logic
(Services)
User Interface
Data Interface
(Dao)
Backend
Front-end
OLTP OLAP
RDBMS
Microservices Architectures
switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020
Building a Spring Boot Microservice
Exposition Layer
Service Layer
Persistence Layer
Database
Data Model
Configuration
Monitoring
Security
Access Patterns
Volume
Throughput
Latency
Security
(Service, Component)
(Controllers)
(Dao, Repository)
switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020
« Vanilla » So easy….
Exposition Layer
Service Layer
Persistence Layer
Database
Microservice
(Service, Component)
(Controllers)
(Dao, Repository)
1
Normalized
Data Model
2 CRUD
switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020
« Vanilla » So easy….
Exposition Layer
Service Layer
Persistence Layer
Database
Microservice
(Service, Component)
(Controllers)
(Dao, Repository)
DATA
DATA-REST
WEB MVC
Configuration
Monitoring
Security
Database Driver
switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020
Entity => Spring-Data => Spring-Data-REST
@Entity
public class Customer {
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
private Long id;
private String firstName;
private String lastName;
private Customer() {}
private Customer(
String firstName, String lastName) {
this.firstName = firstName;
this.lastName = lastName;
}
@RepositoryRestResource(
collectionResourceRel = "customers",
path = "customers")
public interface CustomerRepository extends
CrudRepository<Customer, Long> {
List<Customer> findByLastName(String lastName);
Customer findById(long id);
}
switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020
When volumes grow ?
Exposition Layer
Service Layer
Persistence Layer
Database
Microservice
(Service, Component)
(Controllers)
(Dao, Repository)
CREATE INDEX
JOIN
SHARDING
…
3 CUSTOM QUERIES
switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020
CAP Theorem for Distributed Systems
Consistency Availability
Partition
Tolerance
?
switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020
NEW PROFESSIONAL
JAVA EVENT
MAY 30th, 2020
KYIV, UKRAINE
Cedrick Lunven | Director of Developer Advocacy #DataStax @clunven
Persistence Layer and
Data Model with Apache Cassandra™
2
switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020
NODE
NODE
NODE
NODE
NODE NODE
NODE
Apache Cassandra™
1 Installation = 1 NODE
ü Capacity: ± 1TB
ü Throughput: 3000 Tx/sec/core
Communication:
ü Gossiping
DataCenter | Ring
= Distributed NoSQL Database
switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020
Scales Linearly
• Need more capacity?
• Need more throughput?
• Add nodes!
switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020
Data is Distributed
Country City Habitant
USA New York 8.000.000
USA Los Angeles 4.000.000
FR Paris 2.230.000
DE Berlin 3.350.000
UK London 9.200.000
AU Sydney 4.900.000
FR Toulouse 1.100.000
JP Tokyo 37.430.000
IN Mumbai 20.200.000
DE Nuremberg 500.000
CA Montreal 4.200.000
CA Toronto 6.200.000
Partition Key
switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020
Data is replicated
59 (data)
RF = 3
0
50
33
1783
67
switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020
Data is replicated
RF = 3
0
50
33
1783
67
59 (data)59 (data)
switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020
Data is replicated
RF = 3
0
50
33
1783
67
59 (data)
59 (data)
59 (data)
switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020
Self Healing
RF = 3
0
50
33
1783
67
59 (data)59 (data)
switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020
Self Healing
RF = 3
0
50
33
1783
67
59 (data)
59 (data)
59 (data)
Hint
switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020
Self Healing
RF = 3
0
50
33
1783
67
59 (data)
59 (data)
59 (data)
Hint
switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020
Self Healing
RF = 3
0
50
33
1783
67
59 (data)
59 (data)
59 (data)
switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020
Use Cases
High Throughput
High Volume
Mission Critical
Availability
Realtime
Distributed
Heavy Writes
Heavy Reads
Event Streaming
Internet of Things
Log Analytics
Any TimeSeries
Caching
Market Data
Prices
No Data Loss
Reponsive
System
Any CRUD
API Layer
Geograhically
DeploymentsD
R
A
S
Banking
Track and Trace
Customer Apps Enterprise Data
Layer
Applications
Global Company
Retailers
Hybrid Cloud
MultiCloud
?
switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020
Apache Cassandra MicroServices
• REALTIME REQUESTS & SCALABILITY AT CORE
• DISTRIBUTED ARCHITECTURES
– From ACID to BASE (Basic Availability, Soft-State, Eventual Consistency)
– Implementations: CQRS, Event Sourcing
– Colocate service and Data
• DECOUPLING BY DESIGN
– 1 KEYSPACE = DOMAIN
– 1 QUERY = 1 TABLE
switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020
Reference Application
http://killrvideo.github.io
switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020
Data Model Design
Entities & Relationships
Queries
switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020
Conceptual Data Model
switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020
Application Workflow
R1: Find comments related to target video using its identifier
• Get most recent first
• Implement Paging
R2: Find comments related to target user using its identifier
• Get most recent first
• Implement Paging
R3: Implement CRUD operations
switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020
Mapping
Q2: Find comments posted for a user with a
known id (show most recent first)
comments_by_video
comments_by_user
Q1: Find comments for a video with a
known id (show most recent first)
Q3: CRUD Operations
switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020
Logical Data Model
userid
creationdate
commentid
videoid
comment
comments_by_user
K
C
↑
videoid
creationdate
commentid
userid
comment
comments_by_video
C
↑ K
C
↑
↑C
switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020
Physical Data Model
userid
commentid
videoid
comment
comments_by_user
TIMEUUID
K
TEXT
C
UUID
UUID
↑ videoid
commentid
userid
comment
comments_by_video
TIMEUUID
K
TEXT
C
UUID
UUID
↑
switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020
Schema DDL
CREATE TABLE IF NOT EXISTS comments_by_user (
userid uuid,
commentid timeuuid,
videoid uuid,
comment text,
PRIMARY KEY ((userid), commentid)
) WITH CLUSTERING ORDER BY (commentid DESC);
CREATE TABLE IF NOT EXISTS comments_by_video (
videoid uuid,
commentid timeuuid,
userid uuid,
comment text,
PRIMARY KEY ((videoid), commentid)
) WITH CLUSTERING ORDER BY (commentid DESC);
switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020
We have everything we need
Conceptual Data
Model
(Entities, Relations)
Application Workflow
(Queries)
Database Family
(Technos +Table)
switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020
Api Design Methodology
1
killrvideo-dse
Drivers
DAO3
killrvideo-api-rest killrvideo-api-grpc killrvideo-api-graphql
2
switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020
NEW PROFESSIONAL
JAVA EVENT
MAY 30th, 2020
KYIV, UKRAINE
Cedrick Lunven | Director of Developer Advocacy #DataStax @clunven
DEMO
3
switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020
https://github.com/clun
/javafest-2020
docker-compose up –d
switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020
Configuration – 1# Convention
switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020
Configuration – #2 Java Config
switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020
Configuration - #3 Custom Definition
switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020
CLIENT API DRIVER
Parameters
SynchronousQueries
PreparedStatement
& Parameters
Bind
Parameters
BoundStatement
ResultSet
ResultSet
Results
Blocked
API
switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020
CLIENT API DRIVER
v
Parameters
AsyncQueries
PreparedStatement
& Parameters Bind
Parameters
BoundStatement
AsyncResultSet
AsyncResultSet
Result
API
CompletionStage
Callback Hell
switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020
CLIENT API DRIVER
v
Parameters
ReactiveQueries
PreparedStatement
& Parameters Bind
Parameters
Row
ReactiveRow
Flux
API
ReactiveResultSet
Subscribe
BoundStatement
Subscriber.onNext
Query execution
onComplete()
switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020
NEW PROFESSIONAL
JAVA EVENT
MAY 30th, 2020
KYIV, UKRAINE
Cedrick Lunven | Director of Developer Advocacy #DataStax @clunven
DECISION TREE
4
switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020
Analysis Criteria
Conceptual
Data Model
Application
Workflow
(Queries)
Database Family
(Technos +Table)
Caching
Sync vs Async Reactive
SLA (Volume)
Data Integrity
Filters
Paging
Sort
Latencies Throughput
Versionning
Confidentiality
Atomicity
Cardinality
Developers
Users/Consumers
Language
CodeFirst/
Vs SchemaFirst
Documentation
Test
Build
Packaging
Api Catalog
Internal vs
Public Techno
Profile
XP
switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020
Analysis Matrix
switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020
Decision Tree
switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020
v Decoupling Client / Server (Schema on read)
v Api Lifecycle (Versioning)
v Tooling (API Management, Serverless)
v Verbose payloads (json, xml)
v No discoverability
v Not suitable for command-like (functions) API
v CRUD superstar
v Relevant for mutations (OLTP)
v Public and web APIs
switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020
v High Performances (http/2 – binary serialisation)
v Multiple stubs : Sync, Async, Streaming
v Multi languages - Interoperability
v Strongly coupled (schema with proto files)
v No discoverability
v Protobuf serialization format
v Distributed network of services (no waits)
v High throughput & streaming use cases
v Command-like (eg: slack)
switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020
v Discoverability, documentation
v Custom payloads
v Match standards (Json | Http)
v Single endpoint (versioning, monitoring, security)
v Complex implementation (tooling, still young)
v Nice for customers nasty for DB (N+1 select)
v Backend for frontend (JS)
v Service aggregation | composition (joins)
v When volume matters (mobile phones)
GraphQL
switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020
NEW PROFESSIONAL
JAVA EVENT
MAY 30th, 2020
KYIV, UKRAINE
Cedrick Lunven | Director of Developer Advocacy #DataStax @clunven
RESOURCES
5
switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020
Github repo
https://github.com/clun/javafest-2020
switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020
DataStax Developers on Youtube
• https://www.youtube
.com/channel/UCAIQ
Y251avaMv7bBv5PCo
-A
switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020
Sample CODES
Micro-service REST
https://bit.ly/31RL62I
Micro-service GraphQL
https://bit.ly/2MVicup
Micro-service GRPC Micro-service Kafka
Reactive with Webflux Micro-service Serverless
https://bit.ly/2pofk0b
https://bit.ly/34ePzhL
https://bit.ly/2JwsFdM
https://bit.ly/31VQz8G
switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020
community.datastax.com
switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020
NEW PROFESSIONAL
JAVA EVENT
MAY 30th, 2020
KYIV, UKRAINE
THANK YOU ! (@clunven)
1 of 55

Recommended

Gwt RPC by
Gwt RPCGwt RPC
Gwt RPCmaheshm1206
1K views16 slides
"Enabling Googley microservices with gRPC." at Devoxx France 2017 by
"Enabling Googley microservices with gRPC." at Devoxx France 2017"Enabling Googley microservices with gRPC." at Devoxx France 2017
"Enabling Googley microservices with gRPC." at Devoxx France 2017Alex Borysov
1.7K views121 slides
Pyparis2017 / Scikit-learn - an incomplete yearly review, by Gael Varoquaux by
Pyparis2017 / Scikit-learn - an incomplete yearly review, by Gael VaroquauxPyparis2017 / Scikit-learn - an incomplete yearly review, by Gael Varoquaux
Pyparis2017 / Scikit-learn - an incomplete yearly review, by Gael VaroquauxPôle Systematic Paris-Region
588 views33 slides
OpenACC Highlights - February by
OpenACC Highlights - FebruaryOpenACC Highlights - February
OpenACC Highlights - FebruaryNVIDIA
2K views11 slides
Accumulo Summit 2014: Accumulo backed Tinkerpop Implementation by
Accumulo Summit 2014: Accumulo backed Tinkerpop ImplementationAccumulo Summit 2014: Accumulo backed Tinkerpop Implementation
Accumulo Summit 2014: Accumulo backed Tinkerpop ImplementationAccumulo Summit
803 views20 slides
Big Data Solutions for the Climate Community by
Big Data Solutions for the Climate CommunityBig Data Solutions for the Climate Community
Big Data Solutions for the Climate CommunityEUDAT
92 views32 slides

More Related Content

Similar to JavaFest. Cedrick Lunven. Build APIS with SpringBoot - REST, GRPC, GRAPHQL which one should you pick?

Designing API: REST | gRPC | GraphQL, which one should you pick? - Cedrick Lu... by
Designing API: REST | gRPC | GraphQL, which one should you pick? - Cedrick Lu...Designing API: REST | gRPC | GraphQL, which one should you pick? - Cedrick Lu...
Designing API: REST | gRPC | GraphQL, which one should you pick? - Cedrick Lu...Shift Conference
104 views36 slides
Shift Dev Conf API by
Shift Dev Conf APIShift Dev Conf API
Shift Dev Conf APICédrick Lunven
49 views32 slides
Create API for your Databases by
Create API for your DatabasesCreate API for your Databases
Create API for your DatabasesCédrick Lunven
316 views19 slides
Building Event-Driven (Micro) Services with Apache Kafka by
Building Event-Driven (Micro) Services with Apache KafkaBuilding Event-Driven (Micro) Services with Apache Kafka
Building Event-Driven (Micro) Services with Apache KafkaGuido Schmutz
1.4K views47 slides
BDW16 London - William Vambenepe, Google - 3rd Generation Data Platform by
BDW16 London - William Vambenepe, Google - 3rd Generation Data PlatformBDW16 London - William Vambenepe, Google - 3rd Generation Data Platform
BDW16 London - William Vambenepe, Google - 3rd Generation Data PlatformBig Data Week
151 views30 slides
Introduction to R2DBC by
Introduction to R2DBCIntroduction to R2DBC
Introduction to R2DBCRob Hedgpeth
211 views38 slides

Similar to JavaFest. Cedrick Lunven. Build APIS with SpringBoot - REST, GRPC, GRAPHQL which one should you pick?(20)

Designing API: REST | gRPC | GraphQL, which one should you pick? - Cedrick Lu... by Shift Conference
Designing API: REST | gRPC | GraphQL, which one should you pick? - Cedrick Lu...Designing API: REST | gRPC | GraphQL, which one should you pick? - Cedrick Lu...
Designing API: REST | gRPC | GraphQL, which one should you pick? - Cedrick Lu...
Shift Conference104 views
Building Event-Driven (Micro) Services with Apache Kafka by Guido Schmutz
Building Event-Driven (Micro) Services with Apache KafkaBuilding Event-Driven (Micro) Services with Apache Kafka
Building Event-Driven (Micro) Services with Apache Kafka
Guido Schmutz1.4K views
BDW16 London - William Vambenepe, Google - 3rd Generation Data Platform by Big Data Week
BDW16 London - William Vambenepe, Google - 3rd Generation Data PlatformBDW16 London - William Vambenepe, Google - 3rd Generation Data Platform
BDW16 London - William Vambenepe, Google - 3rd Generation Data Platform
Big Data Week151 views
Introduction to R2DBC by Rob Hedgpeth
Introduction to R2DBCIntroduction to R2DBC
Introduction to R2DBC
Rob Hedgpeth211 views
Cloud nativemicroservices jax-london2020 by Emily Jiang
Cloud nativemicroservices   jax-london2020Cloud nativemicroservices   jax-london2020
Cloud nativemicroservices jax-london2020
Emily Jiang247 views
Cloud nativemicroservices jax-london2020 by Emily Jiang
Cloud nativemicroservices   jax-london2020Cloud nativemicroservices   jax-london2020
Cloud nativemicroservices jax-london2020
Emily Jiang134 views
Master a Cloud Native Standard - MicroProfile.pptx by EmilyJiang23
Master a Cloud Native Standard - MicroProfile.pptxMaster a Cloud Native Standard - MicroProfile.pptx
Master a Cloud Native Standard - MicroProfile.pptx
EmilyJiang238 views
Keeping Identity Graphs In Sync With Apache Spark by Databricks
Keeping Identity Graphs In Sync With Apache SparkKeeping Identity Graphs In Sync With Apache Spark
Keeping Identity Graphs In Sync With Apache Spark
Databricks355 views
Introduction to Spring WebFlux #jsug #sf_a1 by Toshiaki Maki
Introduction to Spring WebFlux #jsug #sf_a1Introduction to Spring WebFlux #jsug #sf_a1
Introduction to Spring WebFlux #jsug #sf_a1
Toshiaki Maki18.5K views
Spring5 New Features by Jay Lee
Spring5 New FeaturesSpring5 New Features
Spring5 New Features
Jay Lee387 views
Spring Cloud Data Flow Overview by VMware Tanzu
Spring Cloud Data Flow OverviewSpring Cloud Data Flow Overview
Spring Cloud Data Flow Overview
VMware Tanzu1.4K views
TDC2017 | São Paulo - Trilha BigData How we figured out we had a SRE team at ... by tdc-globalcode
TDC2017 | São Paulo - Trilha BigData How we figured out we had a SRE team at ...TDC2017 | São Paulo - Trilha BigData How we figured out we had a SRE team at ...
TDC2017 | São Paulo - Trilha BigData How we figured out we had a SRE team at ...
tdc-globalcode137 views
How to build an ETL pipeline with Apache Beam on Google Cloud Dataflow by Lucas Arruda
How to build an ETL pipeline with Apache Beam on Google Cloud DataflowHow to build an ETL pipeline with Apache Beam on Google Cloud Dataflow
How to build an ETL pipeline with Apache Beam on Google Cloud Dataflow
Lucas Arruda3.6K views
Cloud nativeworkshop by Emily Jiang
Cloud nativeworkshopCloud nativeworkshop
Cloud nativeworkshop
Emily Jiang141 views
OGCE Overview for SciDAC 2009 by marpierc
OGCE Overview for SciDAC 2009OGCE Overview for SciDAC 2009
OGCE Overview for SciDAC 2009
marpierc506 views
LendingClub RealTime BigData Platform with Oracle GoldenGate by Rajit Saha
LendingClub RealTime BigData Platform with Oracle GoldenGateLendingClub RealTime BigData Platform with Oracle GoldenGate
LendingClub RealTime BigData Platform with Oracle GoldenGate
Rajit Saha1K views

More from FestGroup

JavaFest. Барух Садогурский. DevOps для разработчиков (или против них?!) by
JavaFest. Барух Садогурский. DevOps для разработчиков (или против них?!)JavaFest. Барух Садогурский. DevOps для разработчиков (или против них?!)
JavaFest. Барух Садогурский. DevOps для разработчиков (или против них?!)FestGroup
235 views113 slides
JavaFest. Виктор Полищук. Legacy: как победить в гонке by
JavaFest. Виктор Полищук. Legacy: как победить в гонкеJavaFest. Виктор Полищук. Legacy: как победить в гонке
JavaFest. Виктор Полищук. Legacy: как победить в гонкеFestGroup
199 views62 slides
JavaFest. Philipp Krenn. Scale Elasticsearch for Your Java Applications by
JavaFest. Philipp Krenn. Scale Elasticsearch for Your Java ApplicationsJavaFest. Philipp Krenn. Scale Elasticsearch for Your Java Applications
JavaFest. Philipp Krenn. Scale Elasticsearch for Your Java ApplicationsFestGroup
175 views54 slides
JavaFest. Grzegorz Piwowarek. Hazelcast - Hitchhiker’s Guide by
JavaFest. Grzegorz Piwowarek. Hazelcast - Hitchhiker’s GuideJavaFest. Grzegorz Piwowarek. Hazelcast - Hitchhiker’s Guide
JavaFest. Grzegorz Piwowarek. Hazelcast - Hitchhiker’s GuideFestGroup
122 views61 slides
JavaFest. Денис Макогон. 6 заблуждений относительно современной Java by
JavaFest. Денис Макогон. 6 заблуждений относительно современной JavaJavaFest. Денис Макогон. 6 заблуждений относительно современной Java
JavaFest. Денис Макогон. 6 заблуждений относительно современной JavaFestGroup
176 views44 slides
JavaFest. Taras Boychuk. There is always a choice. Spring Data JDBC vs. Hiber... by
JavaFest. Taras Boychuk. There is always a choice. Spring Data JDBC vs. Hiber...JavaFest. Taras Boychuk. There is always a choice. Spring Data JDBC vs. Hiber...
JavaFest. Taras Boychuk. There is always a choice. Spring Data JDBC vs. Hiber...FestGroup
183 views39 slides

More from FestGroup(10)

JavaFest. Барух Садогурский. DevOps для разработчиков (или против них?!) by FestGroup
JavaFest. Барух Садогурский. DevOps для разработчиков (или против них?!)JavaFest. Барух Садогурский. DevOps для разработчиков (или против них?!)
JavaFest. Барух Садогурский. DevOps для разработчиков (или против них?!)
FestGroup235 views
JavaFest. Виктор Полищук. Legacy: как победить в гонке by FestGroup
JavaFest. Виктор Полищук. Legacy: как победить в гонкеJavaFest. Виктор Полищук. Legacy: как победить в гонке
JavaFest. Виктор Полищук. Legacy: как победить в гонке
FestGroup199 views
JavaFest. Philipp Krenn. Scale Elasticsearch for Your Java Applications by FestGroup
JavaFest. Philipp Krenn. Scale Elasticsearch for Your Java ApplicationsJavaFest. Philipp Krenn. Scale Elasticsearch for Your Java Applications
JavaFest. Philipp Krenn. Scale Elasticsearch for Your Java Applications
FestGroup175 views
JavaFest. Grzegorz Piwowarek. Hazelcast - Hitchhiker’s Guide by FestGroup
JavaFest. Grzegorz Piwowarek. Hazelcast - Hitchhiker’s GuideJavaFest. Grzegorz Piwowarek. Hazelcast - Hitchhiker’s Guide
JavaFest. Grzegorz Piwowarek. Hazelcast - Hitchhiker’s Guide
FestGroup122 views
JavaFest. Денис Макогон. 6 заблуждений относительно современной Java by FestGroup
JavaFest. Денис Макогон. 6 заблуждений относительно современной JavaJavaFest. Денис Макогон. 6 заблуждений относительно современной Java
JavaFest. Денис Макогон. 6 заблуждений относительно современной Java
FestGroup176 views
JavaFest. Taras Boychuk. There is always a choice. Spring Data JDBC vs. Hiber... by FestGroup
JavaFest. Taras Boychuk. There is always a choice. Spring Data JDBC vs. Hiber...JavaFest. Taras Boychuk. There is always a choice. Spring Data JDBC vs. Hiber...
JavaFest. Taras Boychuk. There is always a choice. Spring Data JDBC vs. Hiber...
FestGroup183 views
JavaFest. Вадим Казулькин. Projects Valhalla, Loom and GraalVM by FestGroup
JavaFest. Вадим Казулькин. Projects Valhalla, Loom and GraalVMJavaFest. Вадим Казулькин. Projects Valhalla, Loom and GraalVM
JavaFest. Вадим Казулькин. Projects Valhalla, Loom and GraalVM
FestGroup180 views
JavaFest. Антон Лемешко. Model-Driven Development in the Open Java Universe by FestGroup
JavaFest. Антон Лемешко. Model-Driven Development in the Open Java UniverseJavaFest. Антон Лемешко. Model-Driven Development in the Open Java Universe
JavaFest. Антон Лемешко. Model-Driven Development in the Open Java Universe
FestGroup132 views
JavaFest. Дмитрий Сергеев. Data processing with Kafka Streams and Spring Fram... by FestGroup
JavaFest. Дмитрий Сергеев. Data processing with Kafka Streams and Spring Fram...JavaFest. Дмитрий Сергеев. Data processing with Kafka Streams and Spring Fram...
JavaFest. Дмитрий Сергеев. Data processing with Kafka Streams and Spring Fram...
FestGroup225 views
JavaFest. Nanne Baars. Web application security for developers by FestGroup
JavaFest. Nanne Baars. Web application security for developersJavaFest. Nanne Baars. Web application security for developers
JavaFest. Nanne Baars. Web application security for developers
FestGroup212 views

Recently uploaded

CWP_23995_2013_17_11_2023_FINAL_ORDER.pdf by
CWP_23995_2013_17_11_2023_FINAL_ORDER.pdfCWP_23995_2013_17_11_2023_FINAL_ORDER.pdf
CWP_23995_2013_17_11_2023_FINAL_ORDER.pdfSukhwinderSingh895865
527 views6 slides
AI Tools for Business and Startups by
AI Tools for Business and StartupsAI Tools for Business and Startups
AI Tools for Business and StartupsSvetlin Nakov
107 views39 slides
The Open Access Community Framework (OACF) 2023 (1).pptx by
The Open Access Community Framework (OACF) 2023 (1).pptxThe Open Access Community Framework (OACF) 2023 (1).pptx
The Open Access Community Framework (OACF) 2023 (1).pptxJisc
110 views7 slides
The basics - information, data, technology and systems.pdf by
The basics - information, data, technology and systems.pdfThe basics - information, data, technology and systems.pdf
The basics - information, data, technology and systems.pdfJonathanCovena1
115 views1 slide
Solar System and Galaxies.pptx by
Solar System and Galaxies.pptxSolar System and Galaxies.pptx
Solar System and Galaxies.pptxDrHafizKosar
91 views26 slides
Education and Diversity.pptx by
Education and Diversity.pptxEducation and Diversity.pptx
Education and Diversity.pptxDrHafizKosar
173 views16 slides

Recently uploaded(20)

AI Tools for Business and Startups by Svetlin Nakov
AI Tools for Business and StartupsAI Tools for Business and Startups
AI Tools for Business and Startups
Svetlin Nakov107 views
The Open Access Community Framework (OACF) 2023 (1).pptx by Jisc
The Open Access Community Framework (OACF) 2023 (1).pptxThe Open Access Community Framework (OACF) 2023 (1).pptx
The Open Access Community Framework (OACF) 2023 (1).pptx
Jisc110 views
The basics - information, data, technology and systems.pdf by JonathanCovena1
The basics - information, data, technology and systems.pdfThe basics - information, data, technology and systems.pdf
The basics - information, data, technology and systems.pdf
JonathanCovena1115 views
Solar System and Galaxies.pptx by DrHafizKosar
Solar System and Galaxies.pptxSolar System and Galaxies.pptx
Solar System and Galaxies.pptx
DrHafizKosar91 views
Education and Diversity.pptx by DrHafizKosar
Education and Diversity.pptxEducation and Diversity.pptx
Education and Diversity.pptx
DrHafizKosar173 views
AUDIENCE - BANDURA.pptx by iammrhaywood
AUDIENCE - BANDURA.pptxAUDIENCE - BANDURA.pptx
AUDIENCE - BANDURA.pptx
iammrhaywood84 views
Ch. 7 Political Participation and Elections.pptx by Rommel Regala
Ch. 7 Political Participation and Elections.pptxCh. 7 Political Participation and Elections.pptx
Ch. 7 Political Participation and Elections.pptx
Rommel Regala97 views
PLASMA PROTEIN (2).pptx by MEGHANA C
PLASMA PROTEIN (2).pptxPLASMA PROTEIN (2).pptx
PLASMA PROTEIN (2).pptx
MEGHANA C68 views
Sociology KS5 by WestHatch
Sociology KS5Sociology KS5
Sociology KS5
WestHatch70 views
JiscOAWeek_LAIR_slides_October2023.pptx by Jisc
JiscOAWeek_LAIR_slides_October2023.pptxJiscOAWeek_LAIR_slides_October2023.pptx
JiscOAWeek_LAIR_slides_October2023.pptx
Jisc96 views
REPRESENTATION - GAUNTLET.pptx by iammrhaywood
REPRESENTATION - GAUNTLET.pptxREPRESENTATION - GAUNTLET.pptx
REPRESENTATION - GAUNTLET.pptx
iammrhaywood100 views
Narration lesson plan.docx by TARIQ KHAN
Narration lesson plan.docxNarration lesson plan.docx
Narration lesson plan.docx
TARIQ KHAN112 views
Psychology KS4 by WestHatch
Psychology KS4Psychology KS4
Psychology KS4
WestHatch84 views
11.28.23 Social Capital and Social Exclusion.pptx by mary850239
11.28.23 Social Capital and Social Exclusion.pptx11.28.23 Social Capital and Social Exclusion.pptx
11.28.23 Social Capital and Social Exclusion.pptx
mary850239298 views
ISO/IEC 27001 and ISO/IEC 27005: Managing AI Risks Effectively by PECB
ISO/IEC 27001 and ISO/IEC 27005: Managing AI Risks EffectivelyISO/IEC 27001 and ISO/IEC 27005: Managing AI Risks Effectively
ISO/IEC 27001 and ISO/IEC 27005: Managing AI Risks Effectively
PECB 585 views
EIT-Digital_Spohrer_AI_Intro 20231128 v1.pptx by ISSIP
EIT-Digital_Spohrer_AI_Intro 20231128 v1.pptxEIT-Digital_Spohrer_AI_Intro 20231128 v1.pptx
EIT-Digital_Spohrer_AI_Intro 20231128 v1.pptx
ISSIP369 views

JavaFest. Cedrick Lunven. Build APIS with SpringBoot - REST, GRPC, GRAPHQL which one should you pick?

  • 1. switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020 Cedrick Lunven | Director of Developer Advocacy #DataStax @clunven Build APIS with SpringBoot REST, GRPC, GRAPHQL Which one should you pick?
  • 2. switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020 About me: Cedrick Lunven Director of Developer Advocacy Creator and Maintainer of FF4j Java and Spring Dinosaur
  • 3. switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020 Agenda 50min 2 3 DEMO and Code Browse Data Model & Persistence with Apache Cassandra 1 Anatomy of a Spring Boot Micro service 4 Decision tree 5 Take my code and slides + Q&A
  • 4. switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020 NEW PROFESSIONAL JAVA EVENT MAY 30th, 2020 KYIV, UKRAINE Cedrick Lunven | Director of Developer Advocacy #DataStax @clunven Anatomy of a Spring Boot Microservice 1
  • 5. switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020 Monolithic Business Logic User Interface Data Interface Multichannel UI Mobile UI Web ESB SOA Specialization BUS S1 S2 S3 Sn RDBMS noSQL DataLake Micro Frontend All Things Distributed Web Components SPA Native BFF (Backend for Frontend) Micro Services Data Mesh Api Gateway Service Discovery RDBMS Graph Hadoop Document KV newSQLColumn TSDB Distributed Tracing Containerization Layers Business Logic (Services) User Interface Data Interface (Dao) Backend Front-end OLTP OLAP RDBMS Microservices Architectures
  • 6. switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020 Building a Spring Boot Microservice Exposition Layer Service Layer Persistence Layer Database Data Model Configuration Monitoring Security Access Patterns Volume Throughput Latency Security (Service, Component) (Controllers) (Dao, Repository)
  • 7. switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020 « Vanilla » So easy…. Exposition Layer Service Layer Persistence Layer Database Microservice (Service, Component) (Controllers) (Dao, Repository) 1 Normalized Data Model 2 CRUD
  • 8. switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020 « Vanilla » So easy…. Exposition Layer Service Layer Persistence Layer Database Microservice (Service, Component) (Controllers) (Dao, Repository) DATA DATA-REST WEB MVC Configuration Monitoring Security Database Driver
  • 9. switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020 Entity => Spring-Data => Spring-Data-REST @Entity public class Customer { @Id @GeneratedValue(strategy=GenerationType.AUTO) private Long id; private String firstName; private String lastName; private Customer() {} private Customer( String firstName, String lastName) { this.firstName = firstName; this.lastName = lastName; } @RepositoryRestResource( collectionResourceRel = "customers", path = "customers") public interface CustomerRepository extends CrudRepository<Customer, Long> { List<Customer> findByLastName(String lastName); Customer findById(long id); }
  • 10. switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020 When volumes grow ? Exposition Layer Service Layer Persistence Layer Database Microservice (Service, Component) (Controllers) (Dao, Repository) CREATE INDEX JOIN SHARDING … 3 CUSTOM QUERIES
  • 11. switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020 CAP Theorem for Distributed Systems Consistency Availability Partition Tolerance ?
  • 12. switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020 NEW PROFESSIONAL JAVA EVENT MAY 30th, 2020 KYIV, UKRAINE Cedrick Lunven | Director of Developer Advocacy #DataStax @clunven Persistence Layer and Data Model with Apache Cassandra™ 2
  • 13. switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020 NODE NODE NODE NODE NODE NODE NODE Apache Cassandra™ 1 Installation = 1 NODE ü Capacity: ± 1TB ü Throughput: 3000 Tx/sec/core Communication: ü Gossiping DataCenter | Ring = Distributed NoSQL Database
  • 14. switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020 Scales Linearly • Need more capacity? • Need more throughput? • Add nodes!
  • 15. switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020 Data is Distributed Country City Habitant USA New York 8.000.000 USA Los Angeles 4.000.000 FR Paris 2.230.000 DE Berlin 3.350.000 UK London 9.200.000 AU Sydney 4.900.000 FR Toulouse 1.100.000 JP Tokyo 37.430.000 IN Mumbai 20.200.000 DE Nuremberg 500.000 CA Montreal 4.200.000 CA Toronto 6.200.000 Partition Key
  • 16. switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020 Data is replicated 59 (data) RF = 3 0 50 33 1783 67
  • 17. switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020 Data is replicated RF = 3 0 50 33 1783 67 59 (data)59 (data)
  • 18. switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020 Data is replicated RF = 3 0 50 33 1783 67 59 (data) 59 (data) 59 (data)
  • 19. switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020 Self Healing RF = 3 0 50 33 1783 67 59 (data)59 (data)
  • 20. switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020 Self Healing RF = 3 0 50 33 1783 67 59 (data) 59 (data) 59 (data) Hint
  • 21. switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020 Self Healing RF = 3 0 50 33 1783 67 59 (data) 59 (data) 59 (data) Hint
  • 22. switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020 Self Healing RF = 3 0 50 33 1783 67 59 (data) 59 (data) 59 (data)
  • 23. switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020 Use Cases High Throughput High Volume Mission Critical Availability Realtime Distributed Heavy Writes Heavy Reads Event Streaming Internet of Things Log Analytics Any TimeSeries Caching Market Data Prices No Data Loss Reponsive System Any CRUD API Layer Geograhically DeploymentsD R A S Banking Track and Trace Customer Apps Enterprise Data Layer Applications Global Company Retailers Hybrid Cloud MultiCloud ?
  • 24. switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020 Apache Cassandra MicroServices • REALTIME REQUESTS & SCALABILITY AT CORE • DISTRIBUTED ARCHITECTURES – From ACID to BASE (Basic Availability, Soft-State, Eventual Consistency) – Implementations: CQRS, Event Sourcing – Colocate service and Data • DECOUPLING BY DESIGN – 1 KEYSPACE = DOMAIN – 1 QUERY = 1 TABLE
  • 25. switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020 Reference Application http://killrvideo.github.io
  • 26. switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020 Data Model Design Entities & Relationships Queries
  • 27. switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020 Conceptual Data Model
  • 28. switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020 Application Workflow R1: Find comments related to target video using its identifier • Get most recent first • Implement Paging R2: Find comments related to target user using its identifier • Get most recent first • Implement Paging R3: Implement CRUD operations
  • 29. switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020 Mapping Q2: Find comments posted for a user with a known id (show most recent first) comments_by_video comments_by_user Q1: Find comments for a video with a known id (show most recent first) Q3: CRUD Operations
  • 30. switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020 Logical Data Model userid creationdate commentid videoid comment comments_by_user K C ↑ videoid creationdate commentid userid comment comments_by_video C ↑ K C ↑ ↑C
  • 31. switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020 Physical Data Model userid commentid videoid comment comments_by_user TIMEUUID K TEXT C UUID UUID ↑ videoid commentid userid comment comments_by_video TIMEUUID K TEXT C UUID UUID ↑
  • 32. switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020 Schema DDL CREATE TABLE IF NOT EXISTS comments_by_user ( userid uuid, commentid timeuuid, videoid uuid, comment text, PRIMARY KEY ((userid), commentid) ) WITH CLUSTERING ORDER BY (commentid DESC); CREATE TABLE IF NOT EXISTS comments_by_video ( videoid uuid, commentid timeuuid, userid uuid, comment text, PRIMARY KEY ((videoid), commentid) ) WITH CLUSTERING ORDER BY (commentid DESC);
  • 33. switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020 We have everything we need Conceptual Data Model (Entities, Relations) Application Workflow (Queries) Database Family (Technos +Table)
  • 34. switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020 Api Design Methodology 1 killrvideo-dse Drivers DAO3 killrvideo-api-rest killrvideo-api-grpc killrvideo-api-graphql 2
  • 35. switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020 NEW PROFESSIONAL JAVA EVENT MAY 30th, 2020 KYIV, UKRAINE Cedrick Lunven | Director of Developer Advocacy #DataStax @clunven DEMO 3
  • 36. switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020 https://github.com/clun /javafest-2020 docker-compose up –d
  • 37. switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020 Configuration – 1# Convention
  • 38. switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020 Configuration – #2 Java Config
  • 39. switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020 Configuration - #3 Custom Definition
  • 40. switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020 CLIENT API DRIVER Parameters SynchronousQueries PreparedStatement & Parameters Bind Parameters BoundStatement ResultSet ResultSet Results Blocked API
  • 41. switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020 CLIENT API DRIVER v Parameters AsyncQueries PreparedStatement & Parameters Bind Parameters BoundStatement AsyncResultSet AsyncResultSet Result API CompletionStage Callback Hell
  • 42. switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020 CLIENT API DRIVER v Parameters ReactiveQueries PreparedStatement & Parameters Bind Parameters Row ReactiveRow Flux API ReactiveResultSet Subscribe BoundStatement Subscriber.onNext Query execution onComplete()
  • 43. switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020 NEW PROFESSIONAL JAVA EVENT MAY 30th, 2020 KYIV, UKRAINE Cedrick Lunven | Director of Developer Advocacy #DataStax @clunven DECISION TREE 4
  • 44. switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020 Analysis Criteria Conceptual Data Model Application Workflow (Queries) Database Family (Technos +Table) Caching Sync vs Async Reactive SLA (Volume) Data Integrity Filters Paging Sort Latencies Throughput Versionning Confidentiality Atomicity Cardinality Developers Users/Consumers Language CodeFirst/ Vs SchemaFirst Documentation Test Build Packaging Api Catalog Internal vs Public Techno Profile XP
  • 45. switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020 Analysis Matrix
  • 46. switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020 Decision Tree
  • 47. switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020 v Decoupling Client / Server (Schema on read) v Api Lifecycle (Versioning) v Tooling (API Management, Serverless) v Verbose payloads (json, xml) v No discoverability v Not suitable for command-like (functions) API v CRUD superstar v Relevant for mutations (OLTP) v Public and web APIs
  • 48. switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020 v High Performances (http/2 – binary serialisation) v Multiple stubs : Sync, Async, Streaming v Multi languages - Interoperability v Strongly coupled (schema with proto files) v No discoverability v Protobuf serialization format v Distributed network of services (no waits) v High throughput & streaming use cases v Command-like (eg: slack)
  • 49. switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020 v Discoverability, documentation v Custom payloads v Match standards (Json | Http) v Single endpoint (versioning, monitoring, security) v Complex implementation (tooling, still young) v Nice for customers nasty for DB (N+1 select) v Backend for frontend (JS) v Service aggregation | composition (joins) v When volume matters (mobile phones) GraphQL
  • 50. switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020 NEW PROFESSIONAL JAVA EVENT MAY 30th, 2020 KYIV, UKRAINE Cedrick Lunven | Director of Developer Advocacy #DataStax @clunven RESOURCES 5
  • 51. switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020 Github repo https://github.com/clun/javafest-2020
  • 52. switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020 DataStax Developers on Youtube • https://www.youtube .com/channel/UCAIQ Y251avaMv7bBv5PCo -A
  • 53. switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020 Sample CODES Micro-service REST https://bit.ly/31RL62I Micro-service GraphQL https://bit.ly/2MVicup Micro-service GRPC Micro-service Kafka Reactive with Webflux Micro-service Serverless https://bit.ly/2pofk0b https://bit.ly/34ePzhL https://bit.ly/2JwsFdM https://bit.ly/31VQz8G
  • 54. switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020 community.datastax.com
  • 55. switch(SpringBoot.api()) { Case REST,GRAPHQL,GRPC } | @clunven KYIV, 2020 NEW PROFESSIONAL JAVA EVENT MAY 30th, 2020 KYIV, UKRAINE THANK YOU ! (@clunven)