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

実践、BFF ~ BFFはFiNCのアプリで何を解決したのか ~

izmeal2000
October 30, 2018

実践、BFF ~ BFFはFiNCのアプリで何を解決したのか ~

mobile appの新機能にBFFを導入し、解決した具体的な課題を紹介しています

izmeal2000

October 30, 2018
Tweet

More Decks by izmeal2000

Other Decks in Technology

Transcript

  1. 3 ΞδΣϯμ 1. FiNCʹ͓͚ΔBFFͷ໾ׂ ɹɾBFFͷҰൠతͳఆٛ ɹɾFiNC appͷ๊͑Δ՝୊ ɹɾBFF͕ղܾ͢Δ՝୊ 2. BFFಋೖ࣮ફ

    ɹɾػೳ঺հ ɹɾ՝୊ͱBFFΛ༻͍ͨղܾ ɹɹ- ύϑΥʔϚϯε ɹɹ- ू໿ϩδοΫͷڞ༗ ɹɹ- ϨεϙϯεʹΑΔදࣔ੾Γସ͑ 3. ࠓޙͷల๬
  2. 4 ΞδΣϯμ 1. FiNCʹ͓͚ΔBFFͷ໾ׂ ɹɾBFFͷҰൠతͳఆٛ ɹɾFiNC appͷ๊͑Δ՝୊ ɹɾBFF͕ղܾ͢Δ՝୊ 2. BFFಋೖ࣮ફ

    ɹɾػೳ঺հ ɹɾ՝୊ͱBFFΛ༻͍ͨղܾ ɹɹ- ύϑΥʔϚϯε ɹɹ- ू໿ϩδοΫͷڞ༗ ɹɹ- ϨεϙϯεʹΑΔදࣔ੾Γସ͑ 3. ࠓޙͷల๬
  3. 8 ҰൠతͳBFFͷ໾ׂ service C service B service A client A

    client B BFF ಋೖ؀ڥʹΑͬͯͦͷ໾ׂ͸ҟͳΔ ྫ͑͹ɺ ɾAPIͷू໿ ɾAPIΩϟογϡ ɾServer Side Rendering etc…
  4. 10 FiNC Appͷ๊͑Δ՝୊ user tag Service life-log Service point Service

    Android iOS ɾ ɾ ɾ ɾ௨৴ύϑΥʔϚϯε ɾू໿ϩδοΫͷ෼ࢄ ɾࠣࡉͳڍಈมߋʹ΋ਃ੥͕ඞཁ ू໿ ϩδοΫ ू໿ ϩδοΫ ϞόΠϧ௨৴
  5. 12 BFF͕ղܾ͢Δ՝୊ user tag Service life-log Service point Service Android

    iOS ɾ ɾ ɾ ௨৴ύϑΥʔϚϯε ϞόΠϧ௨৴ ɾෳ਺ͷAPI requestʹΑΔoverhead ɾσʔλ௨৴ྔͷѹഭ ɾ஗͍ճઢͰͷෳ਺request
  6. 13 User tag service Life-log service Point service Android iOS

    BFF ௨৴ͷू໿ BFF͕ղܾ͢Δ՝୊ ϞόΠϧ௨৴ αʔόؒ௨৴ ϞόΠϧճઢ΁ͷෛՙܰݮ ɹɾrequestճ਺ͷ࡟ݮ ɹɾ௨৴σʔλྔͷ࡟ݮ
  7. 14 user tag Service life-log Service point Service Android iOS

    ɾ ɾ ɾ ू໿ ϩδοΫ ू໿ ϩδοΫ ू໿ϩδοΫͷ෼ࢄ BFF͕ղܾ͢Δ՝୊ ɾແବͳ࣮૷ίετ ɾڍಈͷࠩ෼͕ൃੜ͠΍͍͢
  8. 15 user tag Service life-log Service point Service Android iOS

    ɾ ɾ ɾ ू໿ϩδοΫͷڞ༗ BFF͕ղܾ͢Δ՝୊ BFF ू໿ ϩδοΫ ɾҰՕॴ΁ͷ࣮૷ ɾڍಈʹࠩ෼͕ൃੜ͠ͳ͍
  9. 18 ΞδΣϯμ 1. FiNCʹ͓͚ΔBFFͷ໾ׂ ɹɾBFFͷҰൠతͳఆٛ ɹɾFiNC Appͷ๊͑Δ՝୊ ɹɾBFF͕ղܾ͢Δ՝୊ 2. BFFಋೖ࣮ફ

    ɹɾػೳ঺հ ɹɾ՝୊ͱBFFΛ༻͍ͨղܾ ɹɹ- ύϑΥʔϚϯε ɹɹ- ू໿ϩδοΫͷڞ༗ ɹɹ- ϨεϙϯεʹΑΔදࣔ੾Γସ͑ 3. ࠓޙͷల๬
  10. Premium Service 27 ՝୊ͱBFFͰͷղܾ user tag Service life-log Service point

    Service ௨৴ύϑΥʔϚϯε Mission Service EC Service ଟ͗ͯ͢ॻ͚ͳ͍… ܭ15ຊͷrequest
 (on mobileճઢ)
  11. Premium Service 28 ՝୊ͱBFFͰͷղܾ user tag Service life-log Service point

    Service ௨৴ύϑΥʔϚϯε Mission Service EC Service BFF ܭ6ຊͷrequest
 (on mobileճઢ)
  12. 31 ՝୊ͱBFFͰͷղܾ ஗͍APIʹҾ͖ͣΒΕΔ Premium Service user tag Service life-log Service

    point Service Mission Service EC Service BFF ͳΜ͔஗͍… ͳΜ͔஗͍…
  13. Premium Service 33 ՝୊ͱBFFͰͷղܾ user tag Service life-log Service point

    Service ௨৴ύϑΥʔϚϯε Mission Service EC Service BFF
  14. 38 ՝୊ͱBFFͰͷղܾ ू໿ϩδοΫͷڞ༗ `Ϣʔβͷਭ຾ه࿥Λऔಘ͢Δendpoint` { id, started_at, ended_at, feeling }

    `Ϣʔβͷ৯ࣄه࿥Λऔಘ͢Δendpoint` { [ eat_date: meals: [] ] } dataܗࣜͷҟͳΔϥΠϑϩά
  15. 39 ՝୊ͱBFFͰͷղܾ ू໿ϩδοΫͷڞ༗ ٖࣅίʔυ const sleepDataSource =dataSourceBackendService.getSleepDataSource() // ϙΠϯτ෇༩ର৅ͷσʔλιʔε͔Ͳ͏͔ const

    sleepRecord = isPointGiven(sleepDataSource) ? lifelogBackendService.getSleep() : null const userTag = userTagBackendService.getUserTag() if (userTag == ‘premium’) { // ϙΠϯτxഒͷର৅͔ } const isAchieved = sleepRecord != null
  16. 40 ՝୊ͱBFFͰͷղܾ ू໿ϩδοΫͷڞ༗ ٖࣅίʔυ // ࠓ೔ͷา਺Λऔಘ const currentStep = lifelogBackendService.getStep()

    // ࣍ͷϙΠϯτ෇༩ର৅໨ඪΛࢉग़ const nextGoal = pointService.getNextStepGoal(curren tStep)
  17. 42 user tag Service life-log Service point Service Android iOS

    ɾ ɾ ɾ ू໿ϩδοΫͷڞ༗ BFF͕ղܾ͢Δ՝୊ BFF ू໿ ϩδοΫ ෳࡶͳϩδοΫΛҰՕॴʹ ɾ࣮૷ίετͷ࡟ݮ ɾࠩ෼͕ੜ·Εͳ͍
  18. 49 ՝୊ͱBFFͰͷղܾ ϩδοΫΛͲͪΒʹدͤΔ͔ BFF ɹ࢓༷มߋΛॊೈʹ൓ө frontend ɹϢʔβͱͷΠϯλϥΫγϣϯΛ ɹ ॊೈʹ൓ө user

    tag Service life-log Service point Service Android iOS ɾ ɾ ɾ BFF ू໿ ϩδοΫ ू໿ ϩδοΫ ू໿ ϩδοΫ
  19. 62 ՝୊ͱBFFͰͷղܾ ϨεϙϯεʹΑΔදࣔ੾Γସ͑ user tag Service life-log Service point Service

    Android iOS BFF ू໿ ϩδοΫ BFFଆͷू໿ϩδοΫ => ΞϓϦͷਃ੥ͳ͠Ͱमਖ਼͕Մೳ
  20. 63 ΞδΣϯμ 1. FiNCʹ͓͚ΔBFFͷ໾ׂ ɹɾBFFͷҰൠతͳఆٛ ɹɾFiNC Appͷ๊͑Δ՝୊ ɹɾBFF͕ղܾ͢Δ՝୊ 2. BFFಋೖ࣮ફ

    ɹɾػೳ঺հ ɹɾ՝୊ͱBFFΛ༻͍ͨղܾ ɹɹ- ύϑΥʔϚϯε ɹɹ- ϩδοΫͷڞ༗ ɹɹ- ϨεϙϯεʹΑΔදࣔ੾Γସ͑ 3. ࠓޙͷల๬
  21. ࠓޙͷల๬ 71 The BFF is tightly coupled to a specific

    user experience, and will typically be maintained by the same team as the user interface, thereby making it easier to define and adapt the API as the UI requires, while also simplifying process of lining up release of both the client and server components. ௨ৗBFF͸UIνʔϜʹΑͬͯ։ൃ͞ΕΔ΋ͷͰ͋Δ By SamNewman