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
マイクロサービス化を支える継続的切り替え術
Search
Shia
August 24, 2019
Technology
0
450
マイクロサービス化を支える継続的切り替え術
LL2019 の発表です
https://www.ospn.jp/odc2019/modules/eguide/event.php?eid=23
Shia
August 24, 2019
Tweet
Share
More Decks by Shia
See All by Shia
NewEngineering 2024 - 繋がっていくサービスを支える開発環境作り
riseshia
0
5
Hotspot on Coverage
riseshia
0
120
差分ベースで効率的にテストを実行してみる
riseshia
1
620
Cookpad internship 2020 summer - web
riseshia
0
7.5k
Cleaning up a huge ruby application
riseshia
3
11k
Find out potential dead codes from diff
riseshia
0
6.9k
Other Decks in Technology
See All in Technology
【完全版】Dify - LINE Bot連携 考え方と実用テクニック
uezo
2
410
SageMaker学習のツボ / The Key Points of Learning SageMaker
cmhiranofumio
0
180
受託開発でもアジャイル開発できました / Agile in Contract Development
takaking22
9
4.4k
Grafana エコシステムの活用事例 on ABEMA
tetsuya28
3
250
DenoでもViteしたい!インポートパスのエイリアスを指定してラクラクアプリ開発
bengo4com
2
2k
Slackbot × RAG で実現する社内情報検索の最適化
howdy39
2
340
怖くないオフライン機能開発 〜基本的な技術で実現する現場向けオフライン機能 / Developing offline functions without fear ~ Offline functions for the field realized with basic technology
kaminashi
1
110
UE5の雑多なテク
ryuichikawano
0
410
プロダクト開発の貢献をアピールするための目標設計や認知活動 / Goal design and recognition activities to promote product development contributions.
oomatomo
5
890
「ばん・さく・つき・たー!」にならないためにSHIROBAKOから 学んだこと
ysknsid25
3
690
TypeScript x Raycast x AIで変える開発者体験
nagauta
1
260
テストを楽に書きたい
tomorrowkey
1
170
Featured
See All Featured
Happy Clients
brianwarren
97
6.7k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
7
580
Building Applications with DynamoDB
mza
90
6k
Web development in the modern age
philhawksworth
205
10k
Statistics for Hackers
jakevdp
796
220k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
25
1.7k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
249
21k
Adopting Sorbet at Scale
ufuk
73
9k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
504
140k
Why Our Code Smells
bkeepers
PRO
334
57k
Six Lessons from altMBA
skipperchong
26
3.4k
Transcript
ϚΠΫϩαʔϏεԽΛࢧ ͑ΔܧଓతΓସ͑ज़ TIJB!ΫοΫύου
ࣗݾհ w γϜαϯϤϯ !TIJB w ΫοΫύουגࣜձࣾ
ࠓͷ wϞόΕͽ ‣ γεςϜ࣌ͷΓସ͑ઓུ
ϞόΕͽͱ wΨϥέʔ͚ͷαʔϏε wػೳՃ΄΅͍ͯ͠ͳ͍ wΞΫςΟϒͳϢʔβʔݮΒͳ͍
ͷ֓ཁ
ͷϙΠϯτ wڊେͳϞϊϦγοΫΞϓϦ͔Βͷ w"1*ܦ༝ͰϦιʔεΛऔಘ͢Δ ‣ %#XJUIOαʔϏεਏ͍ ‣ ͢Ͱʹ͑ΔϦιʔε"1*͕͋Δ
ͷϙΠϯτ DB
ͷϙΠϯτ DB API αʔϏε
ͷϙΠϯτ w݁ՌɺϏδωεϩδοΫ΄΅࠶࣮ʹ
ͷنײ wΤϯυϙΠϯτͷݸ΄Ͳ wݩίʔυສߦ΄Ͳ
Γସ͑ઓུΛߟ͑Δ
ཁ݅ wҰؾʹΓସ͑ͳ͍ʂʂʂʂʂ ‣ ࣄނͬͨ߹ɺ֬ೝ͠ͳ͍ͱ͍͚ͳ͍ίʔ υͷྔ͕ଟ͍ ‣ ͦͦࣄނΔ͕֬ߴ͍͔ΒΊ͓͍ͯ ͨ΄͏͕͍͍
ͭ·ΓɺͲͬͪʹྲྀ͔͢ Ͱ͖Δ͚ͩࡉ੍͔͘ޚ͍ͨ͠
چαʔϏε ཁ݅ ৽αʔϏε GET /recipes
چαʔϏε ཁ݅ ৽αʔϏε ͦΕҎ֎ GET /recipes
ख๏MPDBUJPOͰؤுΔ location /recipes { proxy_pass new_service; } location / {
proxy_pass old_service; }
چαʔϏε ৽αʔϏε ͦΕҎ֎ GET /recipes ख๏MPDBUJPOͰؤுΔ
ख๏MPDBUJPOͰؤுΔ ࣮Λ༻ҙ͢Δ ৽αʔϏεΛσϓϩΠ /(*/9ͷઃఆΛߋ৽ͯ͠Ϧϩʔυ
ख๏MPDBUJPOͰؤுΕͳ͍ wσϓϩΠຖʹ/(*/9ͷઃఆΛॻ͖͠ ͍ͨʁ wύεಉ͚ͩ͡Ͳॲཧҧ͏߹ʁ ‣ (&5SFDJQFTWT1045SFDJQFT
ਅͷཁ݅ wΓସ͑खॱΛ؆୯ʹ͍ͨ͠ wΤϯυϙΠϯτ ΞΫγϣϯ ୯ҐͰ Γସ͍͑ͨ
৽αʔϏεʹΓସ͑ͷ ܾఆݖΛҠৡ͢Δ
w৽αʔϏε ‣ ॲཧՄೳͳΒॲཧͯ͠ฦ͢ ‣ ແཧͳΒແཧͱฦ͢ ख๏Γସ͑ͷܾఆݖΛҠৡ͢Δ
ख๏Γସ͑ͷܾఆݖΛҠৡ͢Δ چαʔϏε ৽αʔϏε
ख๏Γସ͑ͷܾఆݖΛҠৡ͢Δ چαʔϏε ৽αʔϏε GET /recipes 200 OK 200 OK
ख๏Γସ͑ͷܾఆݖΛҠৡ͢Δ چαʔϏε ৽αʔϏε GET /recipes Ҏ֎ ະ࣮ͩΑʂʂ
ख๏Γସ͑ͷܾఆݖΛҠৡ͢Δ چαʔϏε ৽αʔϏε GET /recipes Ҏ֎ 200 OK 200 OK
ະ࣮ͩΑʂʂ
w৽αʔϏεଆΛσϓϩΠ͢Δ͚ͩͰ͢ ͕ͯ݁͢Δ ख๏Γସ͑ͷܾఆݖΛҠৡ͢Δ
ख๏࣮ྫ upstream backend { server new_service max_fails=0; server old_service backup;
} server { location / { proxy_next_upstream http_503 non_idempotent; proxy_pass backend; } } ৄ͍͠આ໌͜͜ͰݟΕ·͢ https://techlife.cookpad.com/entry/2019/03/05/115000
ऴΘΓ wͪΐͬͱؤுΕࡉ͔͍୯ҐͰɺ҆શʹ ָͯ͠Γସ͕͑Ͱ͖Δ