SlideShare una empresa de Scribd logo
1 de 55
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)

Más contenido relacionado

Similar a 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...
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
 
Create API for your Databases
Create API for your DatabasesCreate API for your Databases
Create API for your DatabasesCédrick Lunven
 
Building Event-Driven (Micro) Services with Apache Kafka
Building Event-Driven (Micro) Services with Apache KafkaBuilding Event-Driven (Micro) Services with Apache Kafka
Building Event-Driven (Micro) Services with Apache KafkaGuido Schmutz
 
BDW16 London - William Vambenepe, Google - 3rd Generation Data Platform
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
 
Introduction to R2DBC
Introduction to R2DBCIntroduction to R2DBC
Introduction to R2DBCRob Hedgpeth
 
Cloud nativemicroservices jax-london2020
Cloud nativemicroservices   jax-london2020Cloud nativemicroservices   jax-london2020
Cloud nativemicroservices jax-london2020Emily Jiang
 
Cloud nativemicroservices jax-london2020
Cloud nativemicroservices   jax-london2020Cloud nativemicroservices   jax-london2020
Cloud nativemicroservices jax-london2020Emily Jiang
 
Master a Cloud Native Standard - MicroProfile.pptx
Master a Cloud Native Standard - MicroProfile.pptxMaster a Cloud Native Standard - MicroProfile.pptx
Master a Cloud Native Standard - MicroProfile.pptxEmilyJiang23
 
Keeping Identity Graphs In Sync With Apache Spark
Keeping Identity Graphs In Sync With Apache SparkKeeping Identity Graphs In Sync With Apache Spark
Keeping Identity Graphs In Sync With Apache SparkDatabricks
 
Introduction to Spring WebFlux #jsug #sf_a1
Introduction to Spring WebFlux #jsug #sf_a1Introduction to Spring WebFlux #jsug #sf_a1
Introduction to Spring WebFlux #jsug #sf_a1Toshiaki Maki
 
Spring5 New Features
Spring5 New FeaturesSpring5 New Features
Spring5 New FeaturesJay Lee
 
Spring Cloud Data Flow Overview
Spring Cloud Data Flow OverviewSpring Cloud Data Flow Overview
Spring Cloud Data Flow OverviewVMware Tanzu
 
How to build an ETL pipeline with Apache Beam on Google Cloud Dataflow
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 DataflowLucas Arruda
 
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 ...
TDC2017 | São Paulo - Trilha BigData How we figured out we had a SRE team at ...tdc-globalcode
 
Cloud nativeworkshop
Cloud nativeworkshopCloud nativeworkshop
Cloud nativeworkshopEmily Jiang
 
OGCE Overview for SciDAC 2009
OGCE Overview for SciDAC 2009OGCE Overview for SciDAC 2009
OGCE Overview for SciDAC 2009marpierc
 
LendingClub RealTime BigData Platform with Oracle GoldenGate
LendingClub RealTime BigData Platform with Oracle GoldenGateLendingClub RealTime BigData Platform with Oracle GoldenGate
LendingClub RealTime BigData Platform with Oracle GoldenGateRajit Saha
 

Similar a 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...
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 Dev Conf API
Shift Dev Conf APIShift Dev Conf API
Shift Dev Conf API
 
Create API for your Databases
Create API for your DatabasesCreate API for your Databases
Create API for your Databases
 
Building Event-Driven (Micro) Services with Apache Kafka
Building Event-Driven (Micro) Services with Apache KafkaBuilding Event-Driven (Micro) Services with Apache Kafka
Building Event-Driven (Micro) Services with Apache Kafka
 
BDW16 London - William Vambenepe, Google - 3rd Generation Data Platform
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
 
Introduction to R2DBC
Introduction to R2DBCIntroduction to R2DBC
Introduction to R2DBC
 
Cloud nativemicroservices jax-london2020
Cloud nativemicroservices   jax-london2020Cloud nativemicroservices   jax-london2020
Cloud nativemicroservices jax-london2020
 
Cloud nativemicroservices jax-london2020
Cloud nativemicroservices   jax-london2020Cloud nativemicroservices   jax-london2020
Cloud nativemicroservices jax-london2020
 
Master a Cloud Native Standard - MicroProfile.pptx
Master a Cloud Native Standard - MicroProfile.pptxMaster a Cloud Native Standard - MicroProfile.pptx
Master a Cloud Native Standard - MicroProfile.pptx
 
Keeping Identity Graphs In Sync With Apache Spark
Keeping Identity Graphs In Sync With Apache SparkKeeping Identity Graphs In Sync With Apache Spark
Keeping Identity Graphs In Sync With Apache Spark
 
Introduction to Spring WebFlux #jsug #sf_a1
Introduction to Spring WebFlux #jsug #sf_a1Introduction to Spring WebFlux #jsug #sf_a1
Introduction to Spring WebFlux #jsug #sf_a1
 
Spring5 New Features
Spring5 New FeaturesSpring5 New Features
Spring5 New Features
 
Data Science on Google Cloud Platform
Data Science on Google Cloud PlatformData Science on Google Cloud Platform
Data Science on Google Cloud Platform
 
Spring Cloud Data Flow Overview
Spring Cloud Data Flow OverviewSpring Cloud Data Flow Overview
Spring Cloud Data Flow Overview
 
How to build an ETL pipeline with Apache Beam on Google Cloud Dataflow
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
 
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 ...
TDC2017 | São Paulo - Trilha BigData How we figured out we had a SRE team at ...
 
Cloud nativeworkshop
Cloud nativeworkshopCloud nativeworkshop
Cloud nativeworkshop
 
OGCE Overview for SciDAC 2009
OGCE Overview for SciDAC 2009OGCE Overview for SciDAC 2009
OGCE Overview for SciDAC 2009
 
AppSync and GraphQL on iOS
AppSync and GraphQL on iOSAppSync and GraphQL on iOS
AppSync and GraphQL on iOS
 
LendingClub RealTime BigData Platform with Oracle GoldenGate
LendingClub RealTime BigData Platform with Oracle GoldenGateLendingClub RealTime BigData Platform with Oracle GoldenGate
LendingClub RealTime BigData Platform with Oracle GoldenGate
 

Más de FestGroup

JavaFest. Барух Садогурский. DevOps для разработчиков (или против них?!)
JavaFest. Барух Садогурский. DevOps для разработчиков (или против них?!)JavaFest. Барух Садогурский. DevOps для разработчиков (или против них?!)
JavaFest. Барух Садогурский. DevOps для разработчиков (или против них?!)FestGroup
 
JavaFest. Виктор Полищук. Legacy: как победить в гонке
JavaFest. Виктор Полищук. Legacy: как победить в гонкеJavaFest. Виктор Полищук. Legacy: как победить в гонке
JavaFest. Виктор Полищук. Legacy: как победить в гонкеFestGroup
 
JavaFest. Philipp Krenn. Scale Elasticsearch for Your Java Applications
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
 
JavaFest. Grzegorz Piwowarek. Hazelcast - Hitchhiker’s Guide
JavaFest. Grzegorz Piwowarek. Hazelcast - Hitchhiker’s GuideJavaFest. Grzegorz Piwowarek. Hazelcast - Hitchhiker’s Guide
JavaFest. Grzegorz Piwowarek. Hazelcast - Hitchhiker’s GuideFestGroup
 
JavaFest. Денис Макогон. 6 заблуждений относительно современной Java
JavaFest. Денис Макогон. 6 заблуждений относительно современной JavaJavaFest. Денис Макогон. 6 заблуждений относительно современной Java
JavaFest. Денис Макогон. 6 заблуждений относительно современной JavaFestGroup
 
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...
JavaFest. Taras Boychuk. There is always a choice. Spring Data JDBC vs. Hiber...FestGroup
 
JavaFest. Вадим Казулькин. Projects Valhalla, Loom and GraalVM
JavaFest. Вадим Казулькин. Projects Valhalla, Loom and GraalVMJavaFest. Вадим Казулькин. Projects Valhalla, Loom and GraalVM
JavaFest. Вадим Казулькин. Projects Valhalla, Loom and GraalVMFestGroup
 
JavaFest. Антон Лемешко. Model-Driven Development in the Open Java Universe
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 UniverseFestGroup
 
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...
JavaFest. Дмитрий Сергеев. Data processing with Kafka Streams and Spring Fram...FestGroup
 
JavaFest. Nanne Baars. Web application security for developers
JavaFest. Nanne Baars. Web application security for developersJavaFest. Nanne Baars. Web application security for developers
JavaFest. Nanne Baars. Web application security for developersFestGroup
 

Más de FestGroup (10)

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

Último

Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfUmakantAnnand
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 

Último (20)

Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.Compdf
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 

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)