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

20210223 Golang meetup - 輕鬆「Go」建事件驅動應用

20210223 Golang meetup - 輕鬆「Go」建事件驅動應用

20210223 Golang meetup - 輕鬆「Go」建事件驅動應用 by Ming Hsu
Golang meetup #56 event: https://www.meetup.com/golang-taipei-meetup/events/276423744/

Event-driven architecture 在近幾年越來越受關注,它不僅幫助我們解耦服務組件、反轉依賴,更可提高系統的 throughput,大幅提升了擴展性。

本次主題會講解 Event-driven 的核心概念,簡介幾種常見的分佈式消息系統,並展示如何輕鬆用 Golang 實作 event-driven application,幫助大家能更快理解。

7975b9fd58c8945ae1c6b38747de7f28?s=128

line_developers_tw2

February 23, 2021
Tweet

Transcript

  1. 輕鬆「Go」建 事件驅動應⽤ Ming Hsu 2021.02

  2. 關於我 2 ୆େࢿ޻ܥࡾ೥ڃ 33rd 台⼤學⽣會資訊長 Ming Hsu (許浩鳴) LINE Taiwan

    / TECHFRESH
  3. 什麼是事件驅動 Messaging systems 如何使⽤ Golang 實現事件驅動 01 02 03 Contents

    3 圖源:我
  4. 1. 事件驅動

  5. What is event 5  ҰݸʮվᏓܥ౷㐫ଶʯతᏓԽ ՄҎੋ࢖༻ऀతᴍ㐝ɺTFOTPSతࢿྉྲྀɺҰච ੒ཱతగᄸࢿਜ౳ 㗞ੜFWFOUతҰํڣੜ㗞ऀ QSPEVDFS

     ઀ᏅFWFOUతҰํڣফඅऀ DPOTVNFS 
  6. 事件驅動架構 6  1VC4VCNPEFM ফඅऀగ㕕Ұ౸Ꮠݸࣄ݅ྲྀ ᙛҰݸࣄ݅㗞ੜ ඃᚙ෍ ޙ။ඃૹڅ༗గ 㕕ሏతফඅऀ &WFOUTUSFBNJOH

     ࣄ݅ඃBQQFOEਐMPHฒଘࡏFWFOU TUPSF  $POTVNFSՄҎჩᢛ೚Ұࣄ݅ྲྀ  &WFOUTPVSDJOHɺ$234 ᩇሜ෼཭
  7. Why 事件驅動 7  ໌֬ݐཱ%PNBJOFWFOUɺҡ࣋ఔࣜᬑքɺҡ࣋෰຿࣏ࣗੑ ղ㪧ܥ౷૊݅ɺᱷࢄґ↳ ҟ㑊႔ཧఏߴܥ౷UISPVHIQVUɺఏߴᎷలੑ ൓᫚ґ↳ɼߋషۙਅመۀ຿ᬓा᮫܎ 3FBDUJWFTZTUFN

  8. 事件驅動與微服務 8  ᅷݯ.JDSPTPGU%PDT

  9. 注意事項 9  ࢖༻લधཁධဟܥ౷ሣࢿྉҰகੑతཁٻ ࢿྉ۩࠷ऴҰகੑత৔ڥֱ༰қ႔ཧ ֬อ෼ࢄࣜަқࢿྉҰகੑతํ๏ɿଟ֊ஈఏަɺTBHBQBUUFSO ֹ֎తҡӡ੒ຊ

  10. 2. Messaging Systems

  11. Overview 11 "QBDIF,BGLB ߴUISPVHIQVU )JHISFMJBCJMJUZBOETDBMBCJMJUZ "UNPTUPODF BUMFBTUPODFEFMJWFSZ (VBSBOUFFNFTTBHFPSEFS JOBQBSUJUJPO 

    1VMMNPEFMTNBSUDMJFOU ࢧԉࣄ݅ճ೻ SFMBZ  ಛผద߹႔ཧେྔࢿྉྲྀ 3BCCJU.2 ᯦׆త࿏༝ػ੍ ਅਖ਼త.2መ࡞".21ڠఆ "UNPTUPODF BUMFBTUPODFEFMJWFSZ 1VTINPEFMTNBSUTFSWFS ద༻ԙෳᯑతSPVUJOH৔ܠ /"544USFBNJOH ඇৗߴతUISPVHIQVU 4JNQMJDJUZ ᫊ྔշ଎ "UNPTUPODF BUMFBTUPODFEFMJWFSZ ໵ࢧԉࣄ݅ճ೻ 1VTINPEFMTNBSUTFSWFS ༻(PMBOHመ࡞త$/$'ሢҊɼඞਢࢧ࣋
  12. Overview 12 "TUVEZPO.PEFSO.FTTBHJOH4ZTUFNT,BGLB 3BCCJU.2BOE/"544USFBNJOH

  13. More NATS 13  /"54ࢧԉ2VFVF(SPVQɼሏ ။ૹਜଉڅॴ༗༗గ㕕๭ DIBOOFMత2VFVFHSPVQɼฒ ሣಉ2VFVF(SPVQతॴ༗ 4VCTDSJCFSෛࡌۉߧɼࣕෆ။ ॏෳᚙૹਜଉ

    /"54తగ㕕ࢧԉUPLFO NBUDIJOHɼՄҎར༻ࠑޭೳ׬ ੒ෳᯑSPVUJOH
  14. Performance 14 

  15. 3. ⽤ Golang 實作事件驅動

  16. Watermill 16 IUUQTHJUIVCDPN5ISFF%PUT-BCTXBUFSNJMM 㢨ॿመ࡞NFTTBHFTUSFBNJOHత(PMBOHMJCSBSZ ౷ҰQVCMJTITVCTDSJCFհ໘ɼҼࠑՄҎ᫊ᱷ׵౸ෆಉఈ૚CSPLFSࣕෆधमվ֩৺ఔ ࣜᛰ ॆᕝኧੑత"1*ᩋզ၇ՄҎঠѲCSPLFSTQFDJpDతઃఆ ։ശଈ༻తNJEEMFXBSFɼᩋզ၇ෆ༻खࠁ5JNFPVUɺ3FUSZɺ3FDPWFSZ౳ॾଟޭೳ আྃ,BGLB҃3BCCJU.2౳ৗݟతCSPLFSɼXBUFSNJMM໵ࢧ࣋)551҃ੋ.Z42- CJOMPH

    'BTUQSPEVDUJPOSFBEZ ৄݟ׭ํᆫྗଌࢼ 
  17. Watermill 17 )BOEMFS֩৺ɿ 1VC4VCɿ

  18. Demo Time 18 IUUQTHJUIVCDPNNJOHITVHPMBOHUBJQFJXBUFSNJMMFYBNQMF

  19. 3. Reference

  20. Links 20 IUUQTXXXSBCCJUNRDPN IUUQLBGLBBQBDIFPSH IUUQTOBUTJP IUUQTXXXSFEIBUDPNFOUPQJDTJOUFHSBUJPOXIBUJTFWFOUESJWFOBSDIJUFDUVSF IUUQTBSYJWPSHQEGQEG IUUQTHJUIVCDPN5ISFF%PUT-BCTXBUFSNJMM IUUQTXBUFSNJMMJPEPDTDRSTCVJMEJOHBSFBENPEFMXJUIUIFFWFOUIBOEMFS

  21. THANK YOU