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
deploy legacy web on the cloud
Search
Ching Yi Chan
November 14, 2014
Programming
2
1.8k
deploy legacy web on the cloud
2014 JCCONF 快講:老舊 Web 上雲端
talk from
http://jcconf.tw/legacy-web-to-cloud.html
Ching Yi Chan
November 14, 2014
Tweet
Share
More Decks by Ching Yi Chan
See All by Ching Yi Chan
[coscup] Reading and modifying the source code of the dbt adapter
qrtt1
0
91
twjug-lite-17 結束了幾個月的 Java Web 培訓 站在人蔘迷途的我
qrtt1
0
65
[twjug-lite] 迷你研發部 [1]
qrtt1
0
1.1k
寫個好懂的程式
qrtt1
1
550
OAuth 2.0 Authorization Code Flow
qrtt1
0
220
types of knowledge
qrtt1
1
1.2k
twjug 小活動
qrtt1
0
400
TWJUG 2019
qrtt1
0
180
Learning Concepts
qrtt1
0
170
Other Decks in Programming
See All in Programming
How to debug Xdebug... or any other weird bug in PHP
dunglas
2
1.5k
Modern Angular with Lightweight Stores: New Rules and Options
manfredsteyer
PRO
0
200
4年間変わらなかった YOUTRUSTのアーキテクチャ
daiki1003
2
710
ECSのサービス間通信 4つの方法を比較する 〜Canary,Blue/Greenも添えて〜
tkikuc
10
1.9k
推し活としてのrails new/oshikatsu_ha_iizo
sakahukamaki
1
390
リリース8年目のサービスの1800個のERBファイルをViewComponentに移行した方法とその結果
katty0324
0
100
ActiveRecordの力でDBのメタデータを迅速に解析する
lnit
5
2.1k
Google Play Consoleデベロッパー アカウントの確認 / Verifying your Play Console developer account
kubode
0
320
飲食業界向けマルチプロダクトを実現させる開発体制とリアルな現状
hiroya0601
1
300
書籍『LangChainとLangGraphによるRAG・AIエージェント[実践]入門』の紹介
os1ma
2
130
実践サーバーレスパフォーマンスチューニング ~その実力に迫る~ / Practical Serverless Performance Tuning ~A Close Look at its Power~
seike460
PRO
2
240
Vaporモードを大規模サービスに最速導入して学びを共有する
kazukishimamoto
3
3.2k
Featured
See All Featured
Git: the NoSQL Database
bkeepers
PRO
425
64k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
250
21k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
37
1.8k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
4
260
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
327
21k
Done Done
chrislema
181
16k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2k
GitHub's CSS Performance
jonrohan
1030
460k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9k
The Power of CSS Pseudo Elements
geoffreycrofte
71
5.3k
Art, The Web, and Tiny UX
lynnandtonic
296
20k
Transcript
老舊 Web 上雲端 qrtt1 #JCConf
ϼᔚ8FCɪථ၌ɽၤ $BDIF $%/ "DUJWF$BDIF ০࿁வϣਪᕚה፯ٙ˴ࠅ˙ج
$BDIF $%/ "DUJWF$BDIF ০࿁வϣਪᕚה፯ٙ˴ࠅ˙ج ྼ᜕ሯٙ˴ਗόҞ՟ ڢ੬ెพ ࠠอܠϽҞ՟ٙ࿁ၾഄଫ ϼᔚ8FCɪථ၌ɽၤ
$BDIF $%/ "DUJWF$BDIF ০࿁வϣਪᕚה፯ٙ˴ࠅ˙ج ྼ᜕ሯٙ˴ਗόҞ՟ ڢ੬ెพ ࠠอܠϽҞ՟ٙ࿁ၾഄଫ ਕٜՑ˰ޢٙး᎘ ϼᔚ8FCɪථ၌ɽၤ
老舊 Web 上雲端 ݊ɓ၇࿁ೌجၪᚐٙ8FCਖ਼ࣩٙయ၈
老舊 Web 上雲端 CBETNFMMɽණΥ όᅵٙEVQMJDBUFEDPEF όᅵٙMPOHNFUIPE DMBTT όᅵٙVOUFTUBCMFDPEF
老舊 Web 上雲端 ͟MFHBDZDPEF˄̙ə ɪථ၌ࠇྌdϞࡈɽۃlll ʔҷ݅Ϟό
老舊 Web + 老舊機器 *5ɛ⨈ٙ Ѣྤ Linux www.iradiopop.com 2.6.26.8-57.fc8
#1 SMP Thu Dec 18 18:59:49 EST 2008 x86_64 x86_64 x86_6
S1 S2 LB Պۨٙ8FCݖ ̨-PBEJOH#BMBODFS ߰ʍࡈܝ၌4FSWFS Ѣྤ
S1 S2 LB Դ͜ඎ တ̈Ըࣛn Ѣྤ
S1 S2 LB ೌجਕeϥዚeஹʔɪeࠠක ᑋٙ-# ึኬΣᒔঐਗٙዚኜ
S1 S2 LB ೌجਕeϥዚeஹʔɪeࠠක ᑋٙ-# ึኬΣᒔঐਗٙዚኜ
S1 S2 LB Ѣྤ Ϥɗ $SBTIᔔᔔؐ ߮༻ٙ4ZT"ENJO
S1 S2 LB ථ၌ Դ͜ඎ တ̈Ըࣛn
S1 S2 LB ථ၌ S3 S4 ఱ̋һεዚኜᱍϞ፺ॆλ
S1 S2 LB ථ၌ ᄳΎᒛٙ8FCேϞ፬ج 4DBMF0VU 4DBMF*O ̥݊ࠢɽ፩Ԅλணࠇٙϓۜ TUJDLZTFTTJPO
ν؈ЫܘϞ፺
貴、順、爽 貴、順、爽 LB ̙˸൯ܘ൮ٙዚኜ
窮 窮 LB ̙݊ɭ ɓছٙʃʮ̡ ε̒͟ک֝ٙዚኜක༊
輕 Ꮸী ཫၑϞࠢd ൯ʔՑԑ1PXFSٙዚኜࣛ ࡡ͉Ҟٙή˙ᜊ࿔ə$16 ࿔ٙή˙ᜊҞə*0
Ꮸী request business logic db query
Ꮸী request business logic cache db query
Ꮸী request business logic cache db query ᔚዚኜٙ*0ˢථ၌ᒔ࿔d ה˸ࡡ͉࿔ٙᜊҞə
Ꮸী request business logic cache db query ᔚዚኜٙ$16ˢථ၌ᒔҞd ה˸ࡡ͉Ҟٙᜊ࿔ə for(…)
{ for(…) { for(…) { /* 很暴⼒力地過濾資料 */ } } }
Ꮸী request cache db query business logic ৎԸ݊ࡈ һ࠽Ҟ՟ٙ࿁ Active
Cache
ܠ༩ Active Cache request cache heavy business logic ϞҞ՟dఱ݊න
ܠ༩ Active Cache request expired cache heavy business logic ӚҞ՟dఱഃ
ഃܙ
ܠ༩ Active Cache request heavy business logic active cache ٝ༸νОһอІʉٙҞ՟
"DUJWF$BDIF ʔഃܙ
ెพ Active Cache Active Cache ༟ࣘཀಂۃ ࣛ d˴ਗࠠҴ༟ࣘ ତϞٙ-JCSBSZ HVBWB$BDIF-PBEFS
BUTMFHBDZDPEF˄ᗭҷd Ӕ֛˸ʔҷDPEFމͦᅺ
ెพ Active Cache Դ͜"01ౢɝ"EWJDF ᜫCVTJOFTTMPHJD˕౪"DUJWF$BDIF ਗ਼NFUIPEDBMMᔷϓDBDIFLFZ ൗ̅NFUIPEDBMMЇDBDIFSFGSFTITDIFEVMFS
active cache ెพ Active Cache request business logic KEY Cached
Refresh Scheduler business logic method call to cache key register key + method call to scheduler
active cache ెพ Active Cache request business logic Cached Refresh
Scheduler cache storage auto refresh business logic Դ͜٫Ցٙ CVTJOFTTMPHJD ॆ͍ٙ CVTJOFTTMPHJD
ెพ Active Cache "DUJWF$BDIF͉Ը݊މəಯˇഃܙࣛගணࠇ ׳ίථ၌ɪdܦ̷ಯˇə#VTZ+PCว༟๕ٙਪᕚ ͟DBDIFSFGSFTITDIFEVMFSࠢՓ-PBEJOH
ྼЪ Active Cache ٙ฿ׂܘᔊఊ Դ͜"01"EWJDFᘗ࿚NFUIPEDBMM ,&:NFUIPE BSHVNFOUT
ྼЪ Active Cache NFUIPE" VTFS*OGP TUS JOU NBQ PUIFS1PKP
LFZTJHOBUVSF@ BSHT<> BSHT<> BSHT<n> NFUIPE"@6TFS!BBBB@TUS@@\B C^@ NFUIPE"@VTFS@TUS@@\B C^@ ϞԬيUP4USJOHܝٙഐ؈ʔΥ͜d౬ϓՉ˼तᅄ˾ಁ
ྼЪ Active Cache ϞԬيdӚϞHFUUFSঐ՟तᅄl ͜"01ᘗ࿚ܔɿਞᅰdႡЪᗆй༟ࣘ NFUIPE# VTFS-JTU DPNQBSBUPS NFUIPE#@VTFS@VTFS@n@DPNQBSBUPS!BC
NFUIPE#@VTFS@VTFS@n@DNQ!4PSU#Z%BUF
ྼЪ Active Cache "DUJWF$BDIFνОٝ༸༈һอək ݊6TFSխ̣ٙఱΟ$BDIF ݊4DIFEVMFSխ̣ٙఱ3FGSFTI javax.servlet.http.HttpServlet.service(HttpServlet.java:641) stacktrace 看到 HttpServlet.service
就當他是 User 唄
Ⴣ˙ ආɝථ၌ࣛ˾d 8FC"QQԱᔚ݊τༀί4FSWFSɪٙ ࠅνОਕᕎዚג༰Ⴣٙ܄˒݊ࡈਪᕚ
Ⴣ˙ ܄˒௰ɽdШ܄˒ٙЗໄܘᏇ҄lll ڛזЬeڶᖯeΙܓeࡾʿen ᕎ7.ዚגܘჃd Шᕎ$%/&EHF-PDBUJPOӚԟჿჃf
Ⴣ˙ л͜$%/ෂਗ࿒༟ࣘdቇΥᔊఊٙ3&45'6-4FSWJDF request / response λჃ˅ྪჃ
Ⴣ˙ λჃ˅ྪჃ filter CDN )551 ࡡԸҢࡁவჿڐ request / response ਕٜՑ˰ޢٙး᎘
л͜$%/ෂਗ࿒༟ࣘdቇΥᔊఊٙ3&45'6-4FSWJDF DBDIFEVSM
Ⴣ˙ਕٜՑ˰ޢٙး᎘ νОԴ$BDIF&YQJSF $%/JOWBMJEBUJPOܘ࿔d౬༩ࢰܘҞ IUUQDEOUJNFXJOEPXUPLFOSDBDIFLFZ IUUQDEOUJNFXJOEPXUPLFOHDBDIFLFZ IUUQDEOUJNFXJOEPXUPLFOCDBDIFLFZ ⼩小⼼心安全問題,不要放敏感資料
$BDIF $%/ "DUJWF$BDIF ০࿁வϣਪᕚה፯ٙ˴ࠅ˙ج ྼ᜕ሯٙ˴ਗόҞ՟ ڢ੬ెพ ࠠอܠϽҞ՟ٙ࿁ၾഄଫ ਕٜՑ˰ޢٙး᎘ 2" ϼᔚ8FCɪථ၌