Slide 1

Slide 1 text

ν ʔϜ Λ C Q R S 2 0 1 8 . 3 . 3 0 We A re J a v a S c r i p t e r s # 1 7

Slide 2

Slide 2 text

P ro f i l e • ϑϩϯτΤϯυΤϯδχΞ at PERSOL • GitHub: boiyaa
 Twitter: boiyaaaaaa

Slide 3

Slide 3 text

C Q R S ίϚϯυΫΤϦ੹຿෼཭ શͯͷॲཧ͸ίϚϯυʢߋ৽ʣ͔ΫΤϦʢࢀরʣͰɺͦΕͧΕඞཁͳ΋ͷ͕ҧ͏͔Β෼͚ͯߏ੒͢Δͱ ͍͏ύλʔϯ ߋ৽ॲཧɿ υϝΠϯϩδοΫ༗ σʔλ੔߹ੑ ࢀরॲཧɿ υϝΠϯϩδοΫແ ύϑΥʔϚϯεͱ͔ݕࡧͷ͠΍͢͞ͱ͔

Slide 4

Slide 4 text

• αʔόʔαΠυͰΑ͘࢖ΘΕΔύλʔϯ • Akka͕༗໊ ߋ৽ ࢀর EventʢߴՄ༻ͳDBʣ Stateʢ޷౎߹ͳDBʣ Command

Slide 5

Slide 5 text

• αʔόʔαΠυ͚ͩͰͷߟ͑ํͰ͸ͳ͍ • ReduxͳΜ͔͸CQRSνοΫͳϑϨʔϜϫʔΫ Event Props Action State ʢAPIͱ͔ ɹLocalStorageͱ͔ʣ Reducer ߋ৽ ࢀর

Slide 6

Slide 6 text

ਓͷ໾ׂ΋͜Μͳײ͡Ͱ෼͚͍ͨͱ͍͏࿩

Slide 7

Slide 7 text

ϑϩϯτΤϯυͱόοΫΤϯυͷ৬຿Λ ϑϩϯτΤϯυɿը໘Λ࡞Δ όοΫΤϯυɿσʔλΛ࡞Δ ͱఆٛ͢Δͱɺ

Slide 8

Slide 8 text

࣮ࡍͷݱ৔ͷ໾ׂ෼୲͸͜͏ͳ͍ͬͯΔ ϑϩϯτΤϯυ୲౰ऀɿϑϩϯτΤϯυʴΫϥΠΞϯτ αΠυόοΫΤϯυ όοΫΤϯυ୲౰ऀɿαʔόʔαΠυόοΫΤϯυ

Slide 9

Slide 9 text

ͱ͍͏ͷ΋ ϑϩϯτΤϯυɹˠɹϑϩϯτΤϯυΤϯδχΞ όοΫΤϯυɹˠɹαʔόʔαΠυΤϯδχΞ ͳΜͰ͜͏ͳͬͯΔʁ

Slide 10

Slide 10 text

FirebaseͳͲΛ࠾༻ͯ͠ΫϥΠΞϯταΠυʹ΄ͱΜͲ ͷϩδοΫΛ͖࣋ͬͯͨΓ͢Δ
 ͰͦΕΛαʔόʔαΠυϨϯμϦϯάͨ͠Γ͢Δ ΫϥΠΞϯτͱαʔόʔͰ࢓ࣄΛ෼͚Δͷ͸࣌୅ʹ ϑΟοτͯ͠ͳ͍ͷͰ͸

Slide 11

Slide 11 text

ࠓҰ౓ ϑϩϯτΤϯυɿը໘Λ࡞Δ όοΫΤϯυɿσʔλΛ࡞Δ ʹཱͪฦͬͯ໾ׂΛఆٛ͠௚͍ͨ͠

Slide 12

Slide 12 text

ը໘Λߏ੒͢Δͷ͸ࢀরॲཧͱͷ૊Έ߹ΘͤͰɺ
 ߋ৽ॲཧ͸ΠϕϯτϋϯυϥͰߦΘΕΔͱ͍͏͜ͱΛ౿ ·͑Δͱɺ • ը໘ͱɺը໘Λߏ੒͢ΔͨΊͷࢀরॲཧΛ࡞Δ • ը໘ͷΠϕϯτϋϯυϥͱߋ৽ॲཧΛ࡞Δ ͱ͍͏ײ͡Ͱ࢓ࣄ΋ߋ৽ܥͱࢀরܥͰ෼཭Ͱ͖ͦ͏

Slide 13

Slide 13 text

Event State Event State ը໘ ΫϥΠΞϯτ αʔόʔ όοΫΤϯυ ΤϯδχΞ ϑϩϯτΤϯυ ΤϯδχΞ ຊདྷͷը໘Λ࡞ΔɾσʔλΛ࡞Δ৬຿ʹूத

Slide 14

Slide 14 text

JavaScript͸ΫϥΠΞϯτɾαʔόʔͲͪΒ΋࡞ΕΔݴ ޠͳ͚ͩ͋ͬͯɺ JavaScripter͸྆ଆ෼͚ͳ͍͜ͱʹ఍߅͕ແ͍ਓ͕ଟ͍ ͱࢥ͏ ͨͩɺ෼໺ԣஅ͢ΔͷͰɺ֤෼໺ͷपล஌ࣝΛந৅Խ͠ ͨπʔϧ΍αʔϏεΛ׆༻͍ͨ͠

Slide 15

Slide 15 text

αʔόʔαΠυാͷਓ޲͚
 ๲େͳϑϩϯτΤϯυΤίγεϜͷΩϟονΞοϓͷखؒΛ͔͚ͣʹࡁΉ΋ͷ • Nuxt.js: 
 VueϕʔεͰɺ΍ΕΔࣄͷଟ͞ͱԱ͑Δࣄͷগͳ͞ͷόϥϯε͕͍͍ • Next.js: 
 Reactϕʔεʹͯ͠͸͔ͳΓԱ͑Δࣄ͸গͳ͘Ͱ͖͍ͯΔ • Redux: 
 αʔόʔαΠυͰCQRS΍͍ͬͯΔਓʹ͸ೃછΈ΍͍͢ͱࢥ͏͠ɺӬଓԽ͍ͨ͠σʔλΛ ѻ͏ϑϨʔϜϫʔΫͱͯ͠ • AMP: 
 ΍ΕΔࣄগͳ͍͚ͲԱ͑Δࣄ͕Ұ൪গͳ͍ɻSPAͰ͸ͳ͍ͷͰαʔόʔαΠυతʹςϯϓ ϨʔτΤϯδϯʹॻ͚͹͍͍ͷͰϋʔυϧ௿͍

Slide 16

Slide 16 text

ϑϩϯτΤϯυാͷਓ޲͚
 αʔόʔαΠυͷՄ༻ੑ΍ύϑΥʔϚϯεΛࣗྗͰ୲อ͢Δͷ͸೉͍͠ͷͰɺӡ༻ϋʔυϧͷ௿͍΋ͷ • Cloud Firestore: 
 σʔλΛΫϥΠΞϯταʔόʔؒͰಉظ͢Δεέʔϥϒϧͳ NoSQLσʔλϕʔεɻ
 ͦͦ͜͜ͷΫΤϦػೳʢ!=ͱ͔orͱ͔ͳ͍ʣɻ·ͩϕʔλ • Cloud Functions for Firebase: 
 Firestore ͷߋ৽ΛτϦΨʔʹ Node.js ͷؔ਺Λ࣮ߦͰ͖ΔͷͰɺෳࡶͳϩδοΫΛॻ͘৔ॴʹ࢖͑Δɻ • Firebase Hosting: 
 ͱͯ΋؆୯ʹ੩తϑΝΠϧΛFastlyͷڧྗͳCDNͰ഑৴Ͱ͖ΔɻυϝΠϯ΍ূ໌ॻ΋ஶ͘͠؆୯ɻ
 Cloud FunctionsͷϓϩΩγ΋Ͱ͖ͯɺαʔόʔαΠυϨϯμϦϯάͨ͠ը໘΋഑৴Ͱ͖Δɻ • AWS AppSync: 
 GraphQLͰDynamoDBʢεέʔϥϒϧͳ NoSQLσʔλϕʔεʣ΍Elasticsearch ServiceʢϑϧϚωʔδυͳݕ ࡧΤϯδϯʣ͔ΒσʔλऔಘͰ͖ΔαʔϏεͳͷͰɺΫΤϦͱ૬ੑ͕ྑͦ͞͏ɻ
 Lambda Ͱ Node.js ͷؔ਺Λ࣮ߦͰ͖ΔͷͰɺෳࡶͳϩδοΫ΋ॻ͚Δɻ·ͩύϒϦοΫϓϨϏϡʔ

Slide 17

Slide 17 text

ͱ͍͏ໝ૝