Slide 1

Slide 1 text

Apidays 2024 GraphQL? “why bother, we have REST” Peter Milne – the old man at Criteo le vieux Criteo

Slide 2

Slide 2 text

2 In the 1980’s – Data storage Hand crafted – you were on your own When I was a 20-something DENTIFICATION DIVISION. PROGRAM-ID. Conditions. AUTHOR. Michael Coughlan. * An example program demonstrating the use of * condition names (level 88's). * The EVALUATE and PERFORM verbs are also used. DATA DIVISION. WORKING-STORAGE SECTION. 01 Char PIC X. 88 Vowel VALUE "a", "e", "i", "o", "u". 88 Consonant VALUE "b", "c", "d", "f", "g", "h" "j" THRU "n", "p" THRU "t", "v" THRU "z". 88 Digit VALUE "0" THRU "9". 88 ValidCharacter VALUE "a" THRU "z", "0" THRU "9". PROCEDURE DIVISION. Begin. DISPLAY "Enter lower case character or digit. No data ends.". ACCEPT Char. PERFORM UNTIL NOT ValidCharacter EVALUATE TRUE WHEN Vowel DISPLAY "The letter " Char " is a vowel." WHEN Consonant DISPLAY "The letter " Char " is a consonant." WHEN Digit DISPLAY Char " is a digit." WHEN OTHER DISPLAY "problems found" END-EVALUATE END-PERFORM STOP RUN.

Slide 3

Slide 3 text

3 Before SQL – proprietary data storage DENTIFICATION DIVISION. PROGRAM-ID. Conditions. AUTHOR. Michael Coughlan. * An example program demonstrating the use of * condition names (level 88's). * The EVALUATE and PERFORM verbs are also used. DATA DIVISION. WORKING-STORAGE SECTION. 01 Char PIC X. 88 Vowel VALUE "a", "e", "i", "o", "u". 88 Consonant VALUE "b", "c", "d", "f", "g", "h" "j" THRU "n", "p" THRU "t", "v" THRU "z". 88 Digit VALUE "0" THRU "9". 88 ValidCharacter VALUE "a" THRU "z", "0" THRU "9". PROCEDURE DIVISION. Begin. DISPLAY "Enter lower case character or digit. No data ends.". ACCEPT Char. PERFORM UNTIL NOT ValidCharacter EVALUATE TRUE WHEN Vowel DISPLAY "The letter " Char " is a vowel." WHEN Consonant DISPLAY "The letter " Char " is a consonant." WHEN Digit DISPLAY Char " is a digit." WHEN OTHER DISPLAY "problems found" END-EVALUATE END-PERFORM STOP RUN. Before SQL • Index files (IMS, DMS) • One file per “table” • Schema in “working storage” You managed: Schema File location Index and data blocks Compaction Backup Transactions Joins

Slide 4

Slide 4 text

4 Before SQL – proprietary data storage DENTIFICATION DIVISION. PROGRAM-ID. Conditions. AUTHOR. Michael Coughlan. * An example program demonstrating the use of * condition names (level 88's). * The EVALUATE and PERFORM verbs are also used. DATA DIVISION. WORKING-STORAGE SECTION. 01 Char PIC X. 88 Vowel VALUE "a", "e", "i", "o", "u". 88 Consonant VALUE "b", "c", "d", "f", "g", "h" "j" THRU "n", "p" THRU "t", "v" THRU "z". 88 Digit VALUE "0" THRU "9". 88 ValidCharacter VALUE "a" THRU "z", "0" THRU "9". PROCEDURE DIVISION. Begin. DISPLAY "Enter lower case character or digit. No data ends.". ACCEPT Char. PERFORM UNTIL NOT ValidCharacter EVALUATE TRUE WHEN Vowel DISPLAY "The letter " Char " is a vowel." WHEN Consonant DISPLAY "The letter " Char " is a consonant." WHEN Digit DISPLAY Char " is a digit." WHEN OTHER DISPLAY "problems found" END-EVALUATE END-PERFORM STOP RUN. Before SQL • Index files (IMS, DMS) • One file per “table” • Schema in “working storage” You managed: Schema File location Index and data blocks Compaction Backup Transactions Joins

Slide 5

Slide 5 text

5 SQL and Relational Databases: Schema: Data Definition Language (DDL) Queries: Data Manipulation Language (DML) Abstractions, compaction, indexing, joins selective columns, aliasing, casting, etc.. … and loads features and tools

Slide 6

Slide 6 text

6 Schema: Data Definition Language (DDL) Queries: Data Manipulation Language (DML) Abstractions, compaction, indexing, joins selective columns, aliasing, casting, etc.. … and loads features and tools SQL and Relational Databases:

Slide 7

Slide 7 text

7 Who am I? – Uncle Pete Australian living in Paris - et mon français est horrible Worked on the first commercial email system in 1980’s 44 years as a hardware and software engineer 24 years as a software architect 15 Years as a commercial helicopter pilot CPL(h) Visited 49 countries, worked in 26, lived in 5 Unhealthy interest in Lego, robotics, deep learning. A mega geek and part-time mad scientist

Slide 8

Slide 8 text

8

Slide 9

Slide 9 text

Distributed computing history from Uncle Pete’s memory (a bit vague)

Slide 10

Slide 10 text

10 History - Networking in the 80’s IBM SNA – Systems network architecture LU6 – Application to application Digital Equipment Corp DecNet Digit Equipment Corp. Networking Channel – Application to application Wang Laboratories WSN – Wang System Networking Remote Port – Application to application Unix – Everyone had a one TCP/IP Sockets – Application to application

Slide 11

Slide 11 text

11 History - Networking in the 80’s What you got: Application to application communication (L6/L7)

Slide 12

Slide 12 text

12 History – Remote Procedure call (late 80’s) Wikipedia. https://en.wikipedia.org/wiki/Remote_procedure_call In distributed computing, a remote procedure call (RPC) is when a computer program causes a procedure (subroutine) to execute in a different address space (commonly on another computer on a shared network), which is coded as if it were a normal (local) procedure call, without the programmer explicitly coding the details for the remote interaction. That is, the programmer writes essentially the same code whether the subroutine is local to the executing program, or remote.[1] This is a form of client–server interaction (caller is client, executor is server), typically implemented via a request–response message-passing system

Slide 13

Slide 13 text

13 History – Remote Procedure call (late 80’s) What you got: Procedure/Function call paradigm with Serialization/De- serialization

Slide 14

Slide 14 text

14 History – DCE (Early 90’s) The Distributed Computing Environment (DCE) software system was developed in the early 1990s from the work of the Open Software Foundation (OSF), a consortium (founded in 1988) that included Apollo Computer (part of Hewlett- Packard from 1989), IBM, Digital Equipment Corporation, and others. The DCE supplies a framework and a toolkit for developing client/server applications. The framework includes: a remote procedure call (RPC) mechanism known as DCE/RPC a naming (directory) service a time service an authentication service a distributed file system (DFS) known as DCE/DFS DCE represented a big step in the direction of standardisation of architectures, which had previously been manufacturer-dependent. Wikipedia https://en.wikipedia.org/wiki/Distributed_Computing_Environment

Slide 15

Slide 15 text

16 History – DCE (Early 90’s) What you got: Standardized RPC + Services

Slide 16

Slide 16 text

17 History – CORBA (90’s) The Common Object Request Broker Architecture (CORBA) is a standard defined by the Object Management Group (OMG) designed to facilitate the communication of systems that are deployed on diverse platforms. CORBA enables collaboration between systems on different operating systems, programming languages, and computing hardware. CORBA uses an object- oriented model although the systems that use the CORBA do not have to be object-oriented. Object Management Group not “Oh My God”

Slide 17

Slide 17 text

18 History – CORBA (90’s)

Slide 18

Slide 18 text

19 History – CORBA (90’s) Object interface defined in Interface Definition Language (Software contract)

Slide 19

Slide 19 text

20 History – CORBA (90’s) Location or Address of the implementation

Slide 20

Slide 20 text

21 History – CORBA (90’s) Code generation

Slide 21

Slide 21 text

22 History – CORBA (90’s) Generated client Generated server operations

Slide 22

Slide 22 text

23 History – CORBA (90’s) Request router

Slide 23

Slide 23 text

24 History – CORBA (90’s) What you got: Distributed Objects – Services and IDL

Slide 24

Slide 24 text

25 History – RMI (Late 90’s) Java Remote Method Invocation (Java RMI) is a Java API that performs remote method invocation, the object-oriented equivalent of remote procedure calls (RPC), with support for direct The original implementation depends on Java Virtual Machine (JVM) class- representation mechanisms and it thus only supports making calls from one JVM to another. The protocol underlying this Java-only implementation is known as Java Remote Method Protocol (JRMP).

Slide 25

Slide 25 text

26 History – RMI (Late 90’s)

Slide 26

Slide 26 text

27 History – RMI (Late 90’s)

Slide 27

Slide 27 text

28 History – RMI (Late 90’s)

Slide 28

Slide 28 text

29 History – RMI (Late 90’s) What you got: Dogmatic Java-ised CORBA

Slide 29

Slide 29 text

30 History – RMI (Late 90’s) What you got: Dogmatic Java-ised CORBA

Slide 30

Slide 30 text

31 History – SOAP (Early 00’s) SOAP (originally Simple Object Access Protocol) is a protocol specification for exchanging structured information in the implementation of web services in computer networks. Its purpose is to induce extensibility, neutrality and independence. It uses XML Information Set for its message format, and relies on application layer protocols, most often Hypertext Transfer Protocol (HTTP) or Simple Mail Transfer Protocol (SMTP), for message negotiation and transmission.

Slide 31

Slide 31 text

32 History – SOAP (Early 00’s) Simple Object Access Protocol NOT

Slide 32

Slide 32 text

33 History – SOAP (Early 00’s) Simple Object Access Protocol NOT

Slide 33

Slide 33 text

34 History – SOAP (Early 00’s) What you got: RPCs and Services thru Firewall Also: … Migraines … Nausea … Hemorrhoids … Self-reflection on career choice

Slide 34

Slide 34 text

35 History – SOAP (Early 00’s) WTF

Slide 35

Slide 35 text

36 History - { REST } Representational state transfer (REST) or RESTful web services is a way of providing interoperability between computer systems on the Internet. REST-compliant Web services allow requesting systems to access and manipulate textual representations of Web resources using a uniform and predefined set of stateless operations. Wikipedia https://en.wikipedia.org/wiki/Representational_state_transfer

Slide 36

Slide 36 text

37 History - { REST }

Slide 37

Slide 37 text

38 Easy Open Powerful CRUD History - { REST }

Slide 38

Slide 38 text

39 Easy Open Powerful CRUD History - { REST } What you got: Sensible SOAP ☺

Slide 39

Slide 39 text

40 History - { REST } Quick and dirty REST is easy • No consistency • Too many ops • Poor separation of concerns

Slide 40

Slide 40 text

41 History - { REST } Quick and dirty REST is easy • No consistency • Too many ops • Poor separation of concerns Good REST is HARD • Consistency • Contracts: OpenAPI • Events: WebHooks • Multiple Ops: Bulk

Slide 41

Slide 41 text

42 History - { REST } Quick and dirty REST is easy • No consistency • Too many ops • Poor separation of concerns Good REST is HARD • Consistency • Contracts: OpenAPI • Events: WebHooks • Multiple Ops: Bulk If you do good rest… you have invented a PROPRIETARY “GraphQL-like solution”

Slide 42

Slide 42 text

43 History - { REST } If you do good rest… you have invented a PROPRIETARY “GraphQL-like solution”

Slide 43

Slide 43 text

GraphQL… Why bother? An Architects perspective

Slide 44

Slide 44 text

45 GraphQL - Foundation GraphQL was created in 2012 and open sourced by Facebook in 2015. In 2019, Facebook and others created the GraphQL Foundation as a neutral, non-profit home for the GraphQL assets and ongoing collaboration, and hosted by The Linux Foundation. The GraphQL Foundation is a fully neutral home for the GraphQL trademark, and provides a means of collecting and distributing membership dues to support core community infrastructure and programs.

Slide 45

Slide 45 text

46 What do you get: Architectural patterns

Slide 46

Slide 46 text

47 What do you get: Architectural patterns Software Contract

Slide 47

Slide 47 text

48 What do you get: Architectural patterns Command Query Responsibility Segregation

Slide 48

Slide 48 text

49 What do you get: Architectural patterns Events – Event Driven – Event Sourcing

Slide 49

Slide 49 text

50 What do you get : Architectural patterns

Slide 50

Slide 50 text

51

Slide 51

Slide 51 text

52 Schema – the software contract Declarative Schema Definition Language Frontend Backend Schema

Slide 52

Slide 52 text

53 Schema Types Type – read model Input – write model Enum – like every other enum Scalar – Int, Float, String, ID, etc. Union Interface – polymorphic specification Describe the data # Marketing Solutions Campaign type MarketingCampaign implements Campaign @key(fields: "id ") { id: ID! # The Campaign name, set by the advertiser. Read-only name: String! # Read-only. The advertiser associated with the Campaign. advertiserId: ID advertiser: Advertiser """ The marketing objective of the Campaign. Can be AppInstall, BrandAwareness, CatalogSales, Conversion, ResellerProgram, StoreSales, Traffic, VideoViews, or Unknown. """ objective: MarketingCampaignObjective # The campaign spend spendLimit: MarketingCampaignSpendLimit # AdSets for the campaign adSets: [AdSet] }

Slide 53

Slide 53 text

54 Schema Types Type – read model Input – write model Enum – like every other enum Scalar – Int, Float, String, ID, etc. Union Interface – polymorphic specification Describe the data # Marketing Solutions Campaign type MarketingCampaign implements Campaign @key(fields: "id ") { id: ID! # The Campaign name, set by the advertiser. Read-only name: String! # Read-only. The advertiser associated with the Campaign. advertiserId: ID advertiser: Advertiser """ The marketing objective of the Campaign. Can be AppInstall, BrandAwareness, CatalogSales, Conversion, ResellerProgram, StoreSales, Traffic, VideoViews, or Unknown. """ objective: MarketingCampaignObjective # The campaign spend spendLimit: MarketingCampaignSpendLimit # AdSets for the campaign adSets: [AdSet] }

Slide 54

Slide 54 text

55 Schema Types Type – read model Input – write model Enum – like every other enum Scalar – Int, Float, String, ID, etc. Union Interface – polymorphic specification Describe the data # Marketing Solutions Campaign type MarketingCampaign implements Campaign @key(fields: "id ") { id: ID! # The Campaign name, set by the advertiser. Read-only name: String! # Read-only. The advertiser associated with the Campaign. advertiserId: ID advertiser: Advertiser """ The marketing objective of the Campaign. Can be AppInstall, BrandAwareness, CatalogSales, Conversion, ResellerProgram, StoreSales, Traffic, VideoViews, or Unknown. """ objective: MarketingCampaignObjective # The campaign spend spendLimit: MarketingCampaignSpendLimit # AdSets for the campaign adSets: [AdSet] }

Slide 55

Slide 55 text

56 Schema Relationships Field type • Optional • Exactly one • Many # Marketing Solutions Campaign type MarketingCampaign implements Campaign @key(fields: "id ") { id: ID! # The Campaign name, set by the advertiser. Read-only name: String! # Read-only. The advertiser associated with the Campaign. advertiserId: ID advertiser: Advertiser """ The marketing objective of the Campaign. Can be AppInstall, BrandAwareness, CatalogSales, Conversion, ResellerProgram, StoreSales, Traffic, VideoViews, or Unknown. """ objective: MarketingCampaignObjective # The campaign spend spendLimit: MarketingCampaignSpendLimit # AdSets for the campaign adSets: [AdSet] } Describe the relationships

Slide 56

Slide 56 text

57 Schema Relationships Field type • Optional • Exactly one • Many # Marketing Solutions Campaign type MarketingCampaign implements Campaign @key(fields: "id ") { id: ID! # The Campaign name, set by the advertiser. Read-only name: String! # Read-only. The advertiser associated with the Campaign. advertiserId: ID advertiser: Advertiser """ The marketing objective of the Campaign. Can be AppInstall, BrandAwareness, CatalogSales, Conversion, ResellerProgram, StoreSales, Traffic, VideoViews, or Unknown. """ objective: MarketingCampaignObjective # The campaign spend spendLimit: MarketingCampaignSpendLimit # AdSets for the campaign adSets: [AdSet] } Describe the relationships

Slide 57

Slide 57 text

58 Schema Relationships Field type • Optional • Exactly one • Many # Marketing Solutions Campaign type MarketingCampaign implements Campaign @key(fields: "id ") { id: ID! # The Campaign name, set by the advertiser. Read-only name: String! # Read-only. The advertiser associated with the Campaign. advertiserId: ID advertiser: Advertiser """ The marketing objective of the Campaign. Can be AppInstall, BrandAwareness, CatalogSales, Conversion, ResellerProgram, StoreSales, Traffic, VideoViews, or Unknown. """ objective: MarketingCampaignObjective # The campaign spend spendLimit: MarketingCampaignSpendLimit # AdSets for the campaign adSets: [AdSet] } Describe the relationships

Slide 58

Slide 58 text

59 Schema Relationships Field type • Optional • Exactly one • Many # Marketing Solutions Campaign type MarketingCampaign implements Campaign @key(fields: "id ") { id: ID! # The Campaign name, set by the advertiser. Read-only name: String! # Read-only. The advertiser associated with the Campaign. advertiserId: ID advertiser: Advertiser """ The marketing objective of the Campaign. Can be AppInstall, BrandAwareness, CatalogSales, Conversion, ResellerProgram, StoreSales, Traffic, VideoViews, or Unknown. """ objective: MarketingCampaignObjective # The campaign spend spendLimit: MarketingCampaignSpendLimit # AdSets for the campaign adSets: [AdSet] } Describe the relationships

Slide 59

Slide 59 text

60 Command Query Responsibly Segregation (CQRS)

Slide 60

Slide 60 text

61 CQRS Pattern Write Read Query Model (physical read model) Command Model (physical write model) Client Entity store (database) Event Store Event Canonical Model

Slide 61

Slide 61 text

62 Schema Operations Query One or more object graph reads Mutation One or more Writes or Commands Subscription Subscribe to events emitted by the server type Query { marketingCampaign(id: ID!): MarketingCampaign marketingCampaigns( advertiserIds: [ID!] offset: Int = 0 limit: Int = 100 ): [MarketingCampaign] retailMediaCampaign(id: ID!): RetailMediaCampaign retailMediaCampaigns( accountId: ID! offset: Int = 0 limit: Int = 100 ): [RetailMediaCampaign] campaigns( accountId: ID! advertiserIds: [ID!] offset: Int = 0 limit: Int = 100 ): [Campaign] } type Mutation { newMarketingCampaign( adveriserId: ID! campaign: NewMarketingCampaign! ): MarketingCampaign! updateMarketingCampaigns(campaign: [UpdateMarketingCampaign!]!): [ID] updateMarketingCampaign( id: ID! campaign: UpdateMarketingCampaign! ): MarketingCampaign

Slide 62

Slide 62 text

63 type Query { marketingCampaign(id: ID!): MarketingCampaign marketingCampaigns( advertiserIds: [ID!] offset: Int = 0 limit: Int = 100 ): [MarketingCampaign] retailMediaCampaign(id: ID!): RetailMediaCampaign retailMediaCampaigns( accountId: ID! offset: Int = 0 limit: Int = 100 ): [RetailMediaCampaign] campaigns( accountId: ID! advertiserIds: [ID!] offset: Int = 0 limit: Int = 100 ): [Campaign] } type Mutation { newMarketingCampaign( adveriserId: ID! campaign: NewMarketingCampaign! ): MarketingCampaign! updateMarketingCampaigns(campaign: [UpdateMarketingCampaign!]!): [ID] updateMarketingCampaign( id: ID! campaign: UpdateMarketingCampaign! ): MarketingCampaign Schema Operations Query One or more object graph reads Mutation One or more Writes or Commands Subscription Subscribe to events emitted by the server

Slide 63

Slide 63 text

64 ): [RetailMediaCampaign] campaigns( accountId: ID! advertiserIds: [ID!] offset: Int = 0 limit: Int = 100 ): [Campaign] } type Mutation { newMarketingCampaign( adveriserId: ID! campaign: NewMarketingCampaign! ): MarketingCampaign! updateMarketingCampaigns(campaign: [UpdateMarketingCampaign!]!): [ID] updateMarketingCampaign( id: ID! campaign: UpdateMarketingCampaign! ): MarketingCampaign newRetailMediaCampaign( accountId: ID! campaign: NewRetailMediaCampaign! ): RetailMediaCampaign! updateRetailMediaCampaign( id: ID! campaign: UpdateRetailMediaCampaign! ): RetailMediaCampaign! } type Subscription { marketingCampaignCreated(advertiserId: ID!): MarketingCampaign! retailMediaCampaignCreated(accountId: ID!): RetailMediaCampaign! } Schema Operations Query One or more object graph reads Mutation One or more Writes or Commands Subscription Subscribe to events emitted by the server

Slide 64

Slide 64 text

65 Events

Slide 65

Slide 65 text

66 ): [RetailMediaCampaign] campaigns( accountId: ID! advertiserIds: [ID!] offset: Int = 0 limit: Int = 100 ): [Campaign] } type Mutation { newMarketingCampaign( adveriserId: ID! campaign: NewMarketingCampaign! ): MarketingCampaign! updateMarketingCampaigns(campaign: [UpdateMarketingCampaign!]!): [ID] updateMarketingCampaign( id: ID! campaign: UpdateMarketingCampaign! ): MarketingCampaign newRetailMediaCampaign( accountId: ID! campaign: NewRetailMediaCampaign! ): RetailMediaCampaign! updateRetailMediaCampaign( id: ID! campaign: UpdateRetailMediaCampaign! ): RetailMediaCampaign! } type Subscription { marketingCampaignCreated(advertiserId: ID!): MarketingCampaign! retailMediaCampaignCreated(accountId: ID!): RetailMediaCampaign! } Schema Operations Query One or more object graph reads Mutation One or more Writes or Commands Subscription Subscribe to events emitted by the server

Slide 66

Slide 66 text

67 Why use GraphQL More than one client (e.g. web + iOS) Care about latency and bandwidth A microservices architecture REST API has gotten so complicated that it’s a significant drag on product development. Decouple frontend and backend to prevent leakage One endpoint to access your data Retrieve only the data your client needs in a single request (flexibility) No need to tailor endpoints for your views No versioning issues Deprecation at a field level Schema discovery

Slide 67

Slide 67 text

68 Why use GraphQL More than one client (e.g. web + iOS) Care about latency and bandwidth A microservices architecture REST API has gotten so complicated that it’s a significant drag on product development. Decouple frontend and backend to prevent leakage One endpoint to access your data Retrieve only the data your client needs in a single request (flexibility) No need to tailor endpoints for your views No versioning issues Deprecation at a field level Schema discovery Frontend Backend Schema

Slide 68

Slide 68 text

69 What is wrong with REST – Nothing really but…

Slide 69

Slide 69 text

70 The whole elephant Whole object when you only need a portion You request an Elephant but only need it’s tusk and 1 toe

Slide 70

Slide 70 text

71 The whole elephant 6 REST calls (without projection) - Elephant - Head - Tusks - Body - Legs - Toes

Slide 71

Slide 71 text

72 Queried object graph Only what you want Only 1 GraphQL query

Slide 72

Slide 72 text

73 Ask for what you want and Only what you want In the Shape that you want Just like SQL

Slide 73

Slide 73 text

74 Real Example Lineitem detail with campaign name Scenario: A web component displays a Lineitem’s details, with Budget information for Edit (form); with a the owning Campaign Name and ID in a header. 7 One operation in GraphQL Three operations in REST

Slide 74

Slide 74 text

75 Real Example Lineitem detail with campaign name and ID

Slide 75

Slide 75 text

76 Endpoint inconsistency REST Multiple endpoints operate with the same-ish object with inconsistencies

Slide 76

Slide 76 text

77 Endpoint inconsistency REST Multiple endpoints operate with the same-ish object with inconsistencies GraphQL Single endpoint Interface polymorphism

Slide 77

Slide 77 text

80

Slide 78

Slide 78 text

81 GraphQL - Why Simplify UI development - One Dialect for Client Server communications - One Endpoint Clean separation of concern Re-use, regulate and aggregate

Slide 79

Slide 79 text

82 Who uses GraphQL – too many to show on one slide

Slide 80

Slide 80 text

83 SQL has: Schema: Data Definition Language Queries: Data Manipulation Language Compaction, indexing, joins selective columns, aliasing … and loads features and tools

Slide 81

Slide 81 text

84 GraphQL has: Schema: Schema Definition Language Operations: Queries, Mutations, Subscriptions Relationships, selective columns, aliasing … and Apollo Client and Server have loads features and tools

Slide 82

Slide 82 text

85 GraphQL is: GraphQL is to distributed computing (RPC, PubSub) as SQL was to data storage

Slide 83

Slide 83 text

Uncle Pete’s advice Le conseil de l’oncle Pete

Slide 84

Slide 84 text

87 Strategy without tactics is the slowest route to victory. La stratégie sans tactique est le chemin le plus lent vers la victoire. Tactics without strategy is the noise before defeat. La tactique sans stratégie est le bruit avant la défaite. - Sun Tzu

Slide 85

Slide 85 text

88 shanty town – bidonville Code first Tactical

Slide 86

Slide 86 text

89 shanty town – bidonville city planning - aménagement de la ville Code First Schema First Strategic

Slide 87

Slide 87 text

90 Sweet spot shanty town – bidonville city planning - aménagement de la ville Code first Schema first Tactical vs Strategic

Slide 88

Slide 88 text

91 GraphQL is not a silver bullet You still need to have a good design

Slide 89

Slide 89 text

92 GraphQL is not a silver bullet Schema (contract) first design type Query { marketingCampaign(id: ID!): MarketingCampaign marketingCampaigns( advertiserIds: [ID!] offset: Int = 0 limit: Int = 100 ): [MarketingCampaign] retailMediaCampaign(id: ID!): RetailMediaCampaign retailMediaCampaigns( accountId: ID! offset: Int = 0 limit: Int = 100 ): [RetailMediaCampaign] campaigns( accountId: ID! advertiserIds: [ID!] offset: Int = 0 limit: Int = 100 Canonical Model – source of truth

Slide 90

Slide 90 text

93 GraphQL is not a silver bullet If you suck at • REST you will suck at GraphQL • SOA you will suck at GraphQL If you service design is poor … GraphQL is not magic

Slide 91

Slide 91 text

94 Technologies I have tried Scala https://github.com/sangria-graphql/sangria C# Platform | ChilliCream GraphQL Platform Java https://github.com/graphql-java/graphql-java Node.js https://github.com/apollographql/apollo-server Apollo Client and Server development is approx. 10x faster/easier compared to Scala Mature tools Declarative Schema Easy to learn

Slide 92

Slide 92 text

95 Technologies I have tried Scala https://github.com/sangria-graphql/sangria C# Platform | ChilliCream GraphQL Platform Java https://github.com/graphql-java/graphql-java Node.js https://github.com/apollographql/apollo-server Apollo Client and Server development is approx. 10x faster/easier compared to Scala Mature tools Declarative Schema Easy to learn Avertissement: histoire ennuyeuse de vieil homme en cours

Slide 93

Slide 93 text

96 Advertencia: historia aburrida del viejo en progreso Technologies I have tried Scala https://github.com/sangria-graphql/sangria C# Platform | ChilliCream GraphQL Platform Java https://github.com/graphql-java/graphql-java Node.js https://github.com/apollographql/apollo-server Apollo Client and Server development is approx. 10x faster/easier compared to Scala Mature tools Declarative Schema Easy to learn

Slide 94

Slide 94 text

Criteo’s Medium articles on GraphQL Thank you!