Slide 1

Slide 1 text

Client Side Join nori May 2018 @1amageek Hello Firebase How are you?

Slide 2

Slide 2 text

Norikazu Muramoto Cookpad Inc Development Manager @1amageek

Slide 3

Slide 3 text

System Device Technology LSI design engineer iOS engineer iOS engineer 2017.5 2015.10 2009.4 Bio @1amageek

Slide 4

Slide 4 text

Salada Firebase Model Framework Pring Firestore Model Framework Bleu Bluetooth Library https://qiita.com/1amageek OSS Library

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

What is Client Side Join #$

Slide 7

Slide 7 text

Relationship

Slide 8

Slide 8 text

Relationship JE OBNF BHF 5BSP )BOBLP .BSV 4BOLBLV JE OBNF " # User table Group table

Slide 9

Slide 9 text

Relationship JE OBNF BHF 5BSP )BOBLP .BSV 4BOLBLV JE OBNF " # User table Group table JE VTFS@JE HSPVQ@JE Member table

Slide 10

Slide 10 text

SELET * FROM member JOIN member.user_id = user.id

Slide 11

Slide 11 text

does not have the function of JOIN.

Slide 12

Slide 12 text

Client Side Join

Slide 13

Slide 13 text

JE VTFS@JE HSPVQ@JE Member table

Slide 14

Slide 14 text

JE VTFS@JE HSPVQ@JE User record JE OBNF BHF 5BSP JE OBNF BHF 5BSP JE OBNF BHF 5BSP

Slide 15

Slide 15 text

Is it really efficient?

Slide 16

Slide 16 text

REST API x (N + 1)

Slide 17

Slide 17 text

WebSocket

Slide 18

Slide 18 text

x 1000

Slide 19

Slide 19 text

x 1000

Slide 20

Slide 20 text

x 30

Slide 21

Slide 21 text

x 30 x page

Slide 22

Slide 22 text

Just think that it is

Slide 23

Slide 23 text

User Information Main Contents Reaction count Mobile Contents

Slide 24

Slide 24 text

Mobile Contents [ { user: { name: “hoge”, thumbnail_url: “https://” }, image_url: “https://”, retweet_count: 12, like_count: 10, comment_count: 12 } ]

Slide 25

Slide 25 text

Mobile Contents [ { user: { name: “hoge”, thumbnail_url: “https://” }, image_url: “https://”, retweet_count: 12, like_count: 10, comment_count: 12 } ]

Slide 26

Slide 26 text

Mobile Contents [ { userID: “user_id” image_url: “https://”, retweet_count: 12, like_count: 10, comment_count: 12 } ] Lazy load User data

Slide 27

Slide 27 text

DEMO

Slide 28

Slide 28 text

Relationship tips

Slide 29

Slide 29 text

/user/:user_id/groups/:group_id /group/:group_id/users/:user_id

Slide 30

Slide 30 text

/user/:user_id /group/:group_id /member/:member_id

Slide 31

Slide 31 text

Thank you