Client Side Join

Client Side Join

I will explain Firebase's ClientSideJoin.
ClientSideJoin is an important way of thinking in Firebase design.

F45851534f21f9469d296950653464be?s=128

1amageek

May 28, 2018
Tweet

Transcript

  1. Client Side Join nori May 2018 @1amageek Hello Firebase How

    are you?
  2. Norikazu Muramoto Cookpad Inc Development Manager @1amageek

  3. System Device Technology LSI design engineer iOS engineer iOS engineer

    2017.5 2015.10 2009.4 Bio @1amageek
  4. Salada Firebase Model Framework Pring Firestore Model Framework Bleu Bluetooth

    Library https://qiita.com/1amageek OSS Library
  5. None
  6. What is Client Side Join #$

  7. Relationship

  8. Relationship JE OBNF BHF  5BSP   )BOBLP 

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

     .BSV   4BOLBLV  JE OBNF  "  # User table Group table JE VTFS@JE HSPVQ@JE       Member table
  10. SELET * FROM member JOIN member.user_id = user.id

  11. does not have the function of JOIN.

  12. Client Side Join

  13. JE VTFS@JE HSPVQ@JE       Member

    table
  14. JE VTFS@JE HSPVQ@JE       User

    record JE OBNF BHF  5BSP  JE OBNF BHF  5BSP  JE OBNF BHF  5BSP 
  15. Is it really efficient?

  16. REST API x (N + 1)

  17. WebSocket

  18. x 1000

  19. x 1000

  20. x 30

  21. x 30 x page

  22. Just think that it is <img src=“#”>

  23. User Information Main Contents Reaction count Mobile Contents

  24. Mobile Contents [ { user: { name: “hoge”, thumbnail_url: “https://”

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

    }, image_url: “https://”, retweet_count: 12, like_count: 10, comment_count: 12 } ]
  26. Mobile Contents [ { userID: “user_id” image_url: “https://”, retweet_count: 12,

    like_count: 10, comment_count: 12 } ] Lazy load User data
  27. DEMO

  28. Relationship tips

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

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

  31. Thank you