Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Firebase data structure and its characteristics

Firebase data structure and its characteristics

It is wrong to adopt RDB for Mobile development.
Mobile development should use NoSQL efficiently. And Firebase is able to do mobile development most efficiently now.

F45851534f21f9469d296950653464be?s=128

1amageek

June 26, 2017
Tweet

Transcript

  1. Firebase data structure and its characteristics nori Jun 2017 @1amageek

    Hello. #Otemachi Firebase #2 Thank you Yahoo Japan
  2. About 1amageek System Device Technology LSI design engineer iOS engineer

    iOS engineer 2017.5 ~ 2015.10 ~ 2009.4 ~ Bio
  3. Bleu Salada OSS Library Bluetooth Library Firebase Library https://github.com/1amageek AssemblyLine

    Multitask Library
  4. Goal

  5. Goal Current Project

  6. Goal

  7. Goal Hello! New Project

  8. Firebase data structure and its characteristics

  9. is NoSQL

  10. UI Atomicity Migration Basically Record Scheme Relationship Durability Cloud Isolation

    Partition-tolerance Cache Transaction
  11. ≒ RDB

  12. ≒ RDB ❌

  13. CAP theorem Consistency Availability Partition-tolerance Մ༻ੑ Ұ؏ੑ ෼அ଱ੑ

  14. Relational database 1. Consistency 2. Availability Bank Stable Network Firebase

    Realtime Databaseͱ͸ͳΜͳͷ͔ʁ CAP theorem
  15. Mobile

  16. Mobile 1. Unstable network 2. Limited resources 3. Development speed

  17. Mobile RDB X Mismatch

  18. Firebase realtime database Unstable Network 1. Partition-tolerance 2. Availability CAP

    theorem
  19. Mobile Firebase X Cool

  20. DEMO

  21. Feed Feed Feed Feed Sample App User Feed Feed Feed

    Feed Feed Photo Photo Photo Photo Photo
  22. How to Design Firebase realtime database 1. Scheme less 2.

    Structure 3. Client side join 4. Denormalization
  23. Some NoSQLs provide soft scheme functions. Mixed Nested Model Model

    Scheme less 1. Type safe 2. Validation
  24. 1. Flat structure can flexibly respond to changes Flat Nested

    Model Structure 2. Nested structure can constitute simple security Model Model Model
  25. Structure Room { room: { room_00: { message_00: true, message_01:

    true } }, message: { message_00: { text: "hollo" }, message_01: { text: "hollo" } } } { room: { room_00: { message_00: { text: "hollo" }, message_01: { text: "hollo" } } } } Flat Nested 1. Flat structure can flexibly respond to changes 2. Nested structure can constitute simple security
  26. Client side join 1. Improve development speed 2. Reduce unnecessary

    communication
  27. Client side join User Information Main Contents Reaction count

  28. Client side join { id: "000000", user: { id: "user_00",

    name: "1amageek", thumbnailURL: "https://**.jpg" followerUserIDs: ["user_01"], followeeUserIDs: ["user_02"], }, content: { id: "content_00", text: "Hello", imageURL: "https://**.jpg" }, retweetUserIDs: ["user_01", "user_02"], commentUserIDs: ["user_01", "user_02"], likeUserIDs: ["user_01", "user_02"], }
  29. Client side join { id: "000000", userID: "user_00", contentID: "content_00",

    retweetUserIDs: ["user_01", "user_02"], commentUserIDs: ["user_01", "user_02"], likeUserIDs: ["user_01", "user_02"], } user: { id: "user_00", name: "1amageek", thumbnailURL: "https://**.jpg" followerUserIDs: ["user_01"], followeeUserIDs: ["user_02"], } content: { id: "content_00", text: "Hello", imageURL: "https://**.jpg" }
  30. Denormalization RDB Firebase Model Normalization Denormalization 1. Denormalization simplifies queries

    2. Improve performance 3. Volume increases
  31. Summary 1. ͏·͍ 2. ΍͍͢ 3. ͸΍͍

  32. Ads PXL Your photos will be born again as a

    wonderful art. This photo collage is what makes you feel more happy and pleased. Let's share the pixel art to all over the world. $0.99
  33. None
  34. Thank you )