Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
When to use golang in production
Search
y_matsuwitter
March 11, 2015
Programming
3
9.5k
When to use golang in production
白ヤギ勉強会発表資料
y_matsuwitter
March 11, 2015
Tweet
Share
More Decks by y_matsuwitter
See All by y_matsuwitter
Product Utilization of Large Language Models Starting Today
ymatsuwitter
3
1.9k
経営・意思・エンジニアリング
ymatsuwitter
23
18k
LLM in 2023 and 2024
ymatsuwitter
8
5.2k
Turbulent Technological Changes and Career Strategies
ymatsuwitter
2
2.5k
LLM in toB Service and Its UX
ymatsuwitter
6
9.9k
Agent and small LLM validation
ymatsuwitter
7
2.9k
Information management for a culture of speed: The story of Notion and LayerX
ymatsuwitter
4
9.6k
Monorepo on AWS
ymatsuwitter
0
260
Tech behind LayerX SaaS products
ymatsuwitter
0
2.9k
Other Decks in Programming
See All in Programming
Vue SFCのtemplateでTypeScriptの型を活用しよう
tsukkee
3
1.5k
外部システム連携先が10を超えるシステムでのアーキテクチャ設計・実装事例
kiwasaki
1
230
プロジェクト新規参入者のリードタイム短縮の観点から見る、品質の高いコードとアーキテクチャを保つメリット
d_endo
1
1k
カスタムしながら理解するGraphQL Connection
yanagii
1
1.3k
Kaigi on Rails 2024 - Rails APIモードのためのシンプルで効果的なCSRF対策 / kaigionrails-2024-csrf
corocn
5
3.4k
LLM生成文章の精度評価自動化とプロンプトチューニングの効率化について
layerx
PRO
2
140
ECS Service Connectのこれまでのアップデートと今後のRoadmapを見てみる
tkikuc
2
210
Content Security Policy入門 セキュリティ設定と 違反レポートのはじめ方 / Introduction to Content Security Policy Getting Started with Security Configuration and Violation Reporting
uskey512
1
440
破壊せよ!データ破壊駆動で考えるドメインモデリング / data-destroy-driven
minodriven
16
4.1k
Amazon Neptuneで始めてみるグラフDB-OpenSearchによるグラフの全文検索-
satoshi256kbyte
4
340
Server Driven Compose With Firebase
skydoves
0
410
Synchronizationを支える技術
s_shimotori
1
150
Featured
See All Featured
Music & Morning Musume
bryan
46
6.1k
A designer walks into a library…
pauljervisheath
202
24k
Six Lessons from altMBA
skipperchong
26
3.5k
Optimising Largest Contentful Paint
csswizardry
33
2.9k
Git: the NoSQL Database
bkeepers
PRO
426
64k
[RailsConf 2023] Rails as a piece of cake
palkan
51
4.9k
For a Future-Friendly Web
brad_frost
175
9.4k
The Cult of Friendly URLs
andyhume
78
6k
Unsuck your backbone
ammeep
668
57k
A Modern Web Designer's Workflow
chriscoyier
692
190k
Docker and Python
trallard
40
3.1k
Being A Developer After 40
akosma
86
590k
Transcript
When to use golang in production @y_matsuwitter 1
ࣗݾհ • ։ൃຊ෦ࣥߦһࡶ༻ • iOS, Android, Infrastructure, Web • Golang!!
Docker!! • ਖ਼࠲ 2
ࠓͷ • ҰൠతͳWeb/AppαʔϏεʹ͓͚ΔGoݴޠͷӡ༻ʹ͍ͭͯ 3
Goݴޠͷಛ • CPUɾϝϞϦ྆໘͔Βݟͯܰྔ • Ͳ͜Ͱಈ࡞͢ΔόΠφϦ • ੩తܕ͚ݴޠ • ฒߦɾฒྻॲཧ͕ॻ͖͍͢ (goroutine)
4
Goݴޠͷۤखͳͷ • LL΄ͲͷॊೈੑͨͤͮΒ͍ʢreflectͱ͔͋Δ͚Ͳʣ 5
Α͋͘ΔWeb/Appͷߏ 6
ࢀߟ: GunosyͷΠϯ ϑϥ AWS ಋೖࣄྫɿGunosyגࣜձࣾΑΓ 7
NativeApp iOS/AndroidͰಈ࡞͢ΔόΠφϦΛੜ͢Δ • go.mobile • go v1.4͔ΒAndroidΞϓϦ࡞Ε·͢ • go v1.5͔ΒiOSαϙʔτ։࢝
8
NativeApp: GunosyͰͷ • go-mobileΛɺGoͱ֤छΫϥΠΞϯτͷϞσϧपΓڞ௨Խʹ ͏ݕ౼ ͔͠͠ࠓͷͱ͜Ζ࣮༻తͰͳ͍ 9
Web App ֤ϖʔδͷHTMLඳը • text͚ɺhtml͚ͦΕͧΕͷTemplateΛඪ४Ͱඋ͍͑ͯ· ͢ • net/httpͰେࣄΓ·͢ ͨͩ͠ɺRailsDjangoͷϖʔδϨϯμϦϯάػߏͱൺΔͱ ॊೈੑ͘ɺΓͳ͍
10
Web Appʹ͍ͭͯ SPA͕ओྲྀʹͳ͍ͬͯΔ͜ͱΛߟ͑ΔͱɺϖʔδͷϗεςΟϯά ʹͦΕ΄Ͳߴػೳඞཁͳ͍ ϑΝΠϧΛฦ͚ͩ͢Ͱ͋ΕGolangͰे ϖʔδͷ։ൃjsͷ্ʹ͔ͬΖ͏ 11
Web Appʹ͍ͭͯ: GunosyͰͷ ฐࣾͷWebApp։ൃͰ • ϖʔδϋϯυϥGo • ϑϩϯτΤϯυʢHTML, JS, CSSʣશͯgulpͰ։ൃ
• σʔλجຊతʹAPIܦ༝Ͱͷऔಘ ͱ͍͏ܗࣜʹ͍ͯ͠·͢ɻ APIܦ༝ʹ౷Ұ͢Δ͜ͱͰωΠςΟϒΞϓϦͱWebͷ༷Λڞ௨ 12
API ओλεΫ: ύϥϝλΛड͚औΓదͳϏδωεϩδοΫΛܦͯ JSONͳͲΛฦ٫͢Δ • Go͕Ұ൪׆༂ • ϋΠύϑΥʔϚϯεͳAPIΛظؒͰߏங͍͢͠ 13
API: GunosyͰͷ • ࣗࣾWebFWͷKamiΛར༻ • ڞ௨ॲཧΛผϦϙδτϦͰཧ͠go get • nginx͔ΒϓϩΩγ͢Δ߹͋Δ •
WebSocketར༻ͷ߹DNSϥϯυϩϏϯͰৼΓ͚͠ GoͰड͚͢Δ 14
ؓٳ: GoͷORMʹ͍ͭͯ • GunosyͰORMΛ͓ͬͯΓ·ͤΜ • GORM͕ओྲྀͳ༷ • ւ֎൛ͷAPIʹͯGorpΛར༻͍ͯ͠Δ 15
AdminApp ओλεΫ: ΞϓϦέʔγϣϯཧऀ͕DB্ͷσʔλɺKPIͳͲ ͷཧΛߦ͏ • GoͷදݱྗͰߏஙͷͨΊʹશͯͷϩδοΫΛهड़͢Δ͜ͱ ͕ଟ͍ • ͜ͷΜdjango-adminRailsAdminΛ͏΄͏͕ͤ 16
AdminApp: GunosyͰͷ • ͓͓ΑͦDjango-admin͕ར༻͞Εͭͭ͋Γ·͢ • KPIμογϡϘʔυʹGeckoBoardMackerelΛݕ౼ɾར ༻͠ӡ༻ίετݮ • Goཧը໘͕Ұ͚ͭͩ͋Γ·͕͢ɺ΄΅ෳࡶͳػೳͷΈʹ ಛԽʢνϟοτΛฦ͢ͳͲʣ
17
ूܭɾόονॲཧ ఆظతʹɺ࣌ʹେنͳσʔλॲཧΛߦ͏ • Goࣗମͷॲཧੑೳߴ͍͕ɺॊೈ͞ʹ͔͚Δ • ෳHostͰεέʔϧͤ͞Α͏ͱ͢ΔͱGoʹ·ͩ͜ͳΕͨ Έ͕ͳ͍ • ...gRPC? 18
ूܭɾόονॲཧ: GunosyͰͷ • ΄ͱΜͲPython + CeleryͰॲཧ͍ͯ͠Δ • େCeleryͰͷࢄ͕εέʔϧ͘͢͠Pythonࢿ࢈͋ ΔͷͰָ •
Ұ෦ͷΩϟογϡΛࡌͤΔΑ͏ͳॲཧAPIͰ༻ͨ͠Goͷ ϞσϧΛ͏͜ͱ 19
ؓٳ: Goͱػցֶश • աڈminhashͱ͔࡞ͬͯΈͨ • ྻॲཧ͕ͭΒ͍ • δΣωϦΫεແ͍ͷͰΧίΠΠmapͳ͍ • Golearnͱ͔͋Γ·͕͢…
20
Πϯϑϥཧɾࢹ • ߏཧChef/AnsibleͳͲΛ͑Δͷͳ͍ • GoΠϯϑϥπʔϧࣗମ૿͍͑ͯΔ • πʔϧΛ͏͜ͱ͋ͬͯɺGoΛ͏͜ͱׂͱগͳ͍ 21
Πϯϑϥཧɾࢹ: GunosyͰͷ • GoͰͨ͠πʔϧಛʹ͋Γ·ͤΜ • ࣾ࠾༻ͷGoπʔϧ܈ Mackerel-agent, Docker, ...etc 22
Ҏ্౿·͑ͯͷఏҊత·ͱΊ • ΞϓϦ։ൃͦΕͧΕͷSDK • WebSPAલఏͰΔ߹ʹGo • APIΛGoɺϋΠύϑΥʔϚϯε͔ͭσϓϩΠ͍͢͠ • ཧը໘django-adminͳͲϑϧελοΫFWָ͕ 23
Ҏ্౿·͑ͯͷఏҊత·ͱΊ(͖ͭͮ) • ूܭɾόονPython + CeleryͳͲطଘࢿ࢈Λ͏΄͏͕Α ͍ • ΠϯϑϥGoπʔϧͷ׆༂͕૿͑Δ 24
࠷ޙʹ • খنͳίʔυϕʔεʹ͑ΔͳΒɺύϑΥʔϚϯεͷ໘͔ ΒݟͯGo࠷ߴ 25