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
YaaMaa
December 23, 2020
Programming
0
1.4k
はてなブログチームでの働き方
YaaMaa
December 23, 2020
Tweet
Share
Other Decks in Programming
See All in Programming
フロントエンドのディレクトリ構成どうしてる? Feature-Sliced Design 導入体験談
osakatechlab
8
4.1k
htmxって知っていますか?次世代のHTML
hiro_ghap1
0
330
Cloudflare MCP ServerでClaude Desktop からWeb APIを構築
kutakutat
1
540
SymfonyCon Vienna 2025: Twig, still relevant in 2025?
fabpot
3
1.2k
【re:Growth 2024】 Aurora DSQL をちゃんと話します!
maroon1st
0
770
今年一番支援させていただいたのは認証系サービスでした
satoshi256kbyte
1
250
MCP with Cloudflare Workers
yusukebe
2
220
暇に任せてProxmoxコンソール 作ってみました
karugamo
2
720
快速入門可觀測性
blueswen
0
350
useSyncExternalStoreを使いまくる
ssssota
6
1k
複雑な仕様に立ち向かうアーキテクチャ
myohei
0
170
CQRS+ES の力を使って効果を感じる / Feel the effects of using the power of CQRS+ES
seike460
PRO
0
120
Featured
See All Featured
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
520
Why Our Code Smells
bkeepers
PRO
335
57k
Faster Mobile Websites
deanohume
305
30k
The Art of Programming - Codeland 2020
erikaheidi
53
13k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
26
1.9k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
Building Adaptive Systems
keathley
38
2.3k
Done Done
chrislema
181
16k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
48
2.2k
Writing Fast Ruby
sferik
628
61k
Being A Developer After 40
akosma
87
590k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
28
2.1k
Transcript
ͯͳϒϩάνʔϜͰͷ ಇ͖ํ )BUFOB&OHJOFFS4FNJOBS JE:BB.BB
ࣗݾհ JE:BB.BB ৽ଔ ͯͳϒϩάνʔϜ ओʹݸਓϢʔβʔ͚ͷ։ൃΛ͍ͯ͠·͢
ࣄͰ͏ͷ 1FSM ϒϩάຊମͷαʔόʔαΠυ (P ϒϩάपลαʔϏεʢͯͳϒϩάλάͳͲʣͷαʔόʔαΠυ +BWB4DSJQU 5ZQF4DSJQU ओʹϑϩϯτΤϯυ
͢͜ͱ ೖࣾͯͬͨ͠தͰҰ൪େมͩͬͨλεΫʹ͍ͭͯ ɾͲ͏ͬͯਐΊ͍͔ͯͬͨ ɾͲ͏͍͏͕͔͋ͬͨ͠͞ ɾࣦഊͨ͜͠ͱͳͲ
λεΫͷ༰ ϒϩάهࣄʹషΓ͚ΒΕͨը૾ͷதͰɺ (PPHMFϑΥτ͔ΒషΓ͚ΒΕͨը૾͕ ӾཡͰ͖ͳ͘ͳͬͯ͠·ͬͨͷͰɺ ͦΕΒΛͯͳϑΥτϥΠϑʹҠߦ͢Δ (PPHMFϑΥτ(PPHMFͷը૾ϗεςΟϯάαʔϏε ͯͳϑΥτϥΠϑͯͳ͕։ൃ͍ͯ͠Δը૾ϗεςΟϯάαʔϏε
λεΫͷ༰ <p>ཱྀߦʹߦͬͨͱ͖ͷࣸਅͰ͢ɻ</p> <img src=“https://hosted-image/0000.jpg”> ϑΥτϥΠϑ 63-ͷ ϑΝΠϧ໊Λ खֻ͔Γʹ ը૾Λ୳͢ ϑΥτϥΠϑͷ
63-ʹॻ͖͑ (PPHMFϑΥτ औಘͨ͠ը૾σʔλΛ Ξοϓϩʔυ
ܭը
ܭը Ҡߦͷඞཁ͕͋Δը૾63-Λચ͍ग़͢ ը૾σʔλΛ63-͔ΒऔಘͰ͖Δͷͱ Ͱ͖ͳ͍ͷʹબผ औಘͰ͖Δ Ͱ͖ͳ͍ Ϣʔβʔʹ(PPHMFೝূͯ͠Βͬͯɺ (PPHMFϑΥτͷ"1*Λͬͯ
ը૾Λ୳ͯ͠औಘ
ܭը औಘͨ͠ը૾σʔλΛ ϢʔβʔͷϑΥτϥΠϑʹΞοϓϩʔυ هࣄͷը૾63-Λ ϑΥτϥΠϑͰͷ63-ʹஔ͖͍͑ͯ͘
ܭը ը૾ͷใΛೖΕΔ%#ςʔϒϧ܈ͷઃܭ id original_url ⋯ status xxxxxx https://… ⋯ initial
id image_id entry_id exists xxxxxx xxxxxx xxxxxx TRUE id image_id s3_url xxxxxx xxxxxx https://… ը૾ هࣄͱը૾ͷ Ϛοϐϯά (PPHMFϑΥτͷ "1*͔Βऔಘͨ͠ը૾
ܭը ܭըΛཱͯͨΒҰ୴ϨϏϡʔͯ͠Β͏ ɾσΟϨΫλʔ ϢʔβʔʹͲΕ͘Β͍ͷखؒΛ͔͚ͤͯ͞͠·͏͔ͳͲ૬ஊ ɾϝϯλʔΤϯδχΞ ٕज़తͳ෦ͷيಓमਖ਼ ے͕ѱ͍͜ͱɾඇޮͳ͜ͱΛ͠Α͏ͱ͍ͯ͠ͳ͍͔
ଞ৬छͱͷ࿈ܞ ϢʔβʔೝূͷҊը໘ σβΠφʔͱ૬ஊ͠ͳ͕ΒڞಉͰը໘Λ࡞͍ͬͯ͘ɻ Ͳ͜ʹ௨Λஔ͔͘ͱ͔͠߹͏ɻ ࠂɾϔϧϓϖʔδ ༷ૢ࡞ํ๏Λ·ͱΊ͔ͯΒɺฤूͷํʹݪߘΛ͓ئ͍͢Δɻ ٬؍తͳࢹͰΘ͔ΓͮΒ͍ͱ͜ΖΛิͯ͠Β͏ɻ
՝ͱରॲ
ϑϩʔ͕ෳࡶ ॳظঢ়ଶ 63-͔Β ը૾औಘޭ 63-͔Β ը૾औಘࣦഊ Ϣʔβʔͷ (PPHMFೝূ "1*Ͱ ը૾Λ୳͠த
ը૾Λ୳͢ͷʹ ࣦഊ ީิ͕ू·ͬͨ ީิ͔Β ߜΓࠐΊͳ͍ ީิ͔Β ҰͭʹಛఆͰ͖ͨ ϑΥτϥΠϑʹ Ξοϓϩʔυத Ξοϓϩʔυ ࣦഊ Ξοϓϩʔυ ྃ هࣄͷॻ͖͑ ྃ هࣄͷॻ͖͑ ࣦഊ ঢ়ଶΛચ͍ग़͢ͷ͕େม
ϑϩʔ͕ෳࡶ ͦΕͰߟྀෆͩͬͨ ɾҠߦ͍ͯ͠Δ్தʹϢʔβʔ͕ୀձͯ͠͠·ͬͨΒʁ ɾҠߦ͍ͯ͠Δ్தʹϢʔβʔ͕ࣗͰҠߦରͷը૾Λॻ͖͑ͨΒʁ ɾϢʔβʔ͕ೝূ͢Δ(PPHMFΞΧϯτΛؒҧ͍͑ͯͯɺ ผͷΞΧϯτͰೝূ͔ͨͬͨ͠͠Βʁ
ϑϩʔͷߟྀෆͷରԠ Ϣʔβʔͷ (PPHMFೝূ "1*Ͱ ը૾Λ୳͠த ը૾Λ୳͢ͷʹ ࣦഊ ީิ͕ू·ͬͨ ީิ͔Β ߜΓࠐΊͳ͍
ෳճϢʔβʔೝূ Ͱ͖ΔΑ͏ʹ ީิ͔Β ҰͭʹಛఆͰ͖ͨ ϑϩʔΛՃ هࣄฤूͷλΠϛϯάͰɺ (PPHMFϑΥτ͔ΒషΓ͚ΒΕͨը૾͕͍ͬͯΔ͔ΛνΣοΫ͢Δ ॲཧΛՃ
ίʔυϨϏϡʔͯ͠Β͏ͷ͕େม ͳΔ͘ϨϏϡʔ͍͢͠Α͏ʹ13Λখ͚ʹ͢Δ͚Ͳɺ ͦ͏͢Δͱݸʑͷ13ͷతҐஔ͚͕Θ͔ΓͮΒ͍ ࡉΕͷ13ͷ༷ࢠ
ίʔυϨϏϡʔͯ͠Β͏ͷ͕େม ϨϏϡϫʔϥϯυϩϏϯͰܾ·ΔͷͰɺ 13ͷܦҢจ຺Βͳ͍
ίʔυϨϏϡʔͯ͠Β͏ͷ͕େม ɾը૾Ͳ͏͍͏ঢ়ଶΛͱΓ͏Δͷ͔ ɾ͜ͷ13ͰͲͷঢ়ଶͷը૾ΛͲͷঢ়ଶʹ͍͖͍࣋ͬͯͨͷ͔ ɾͦΕશମͷఔͷͲͷ͋ͨΓʹҐஔ͢Δͷ͔ Λຖճઆ໌
ྔ͕ଟ͍ ը૾ͷ͕ͻͨ͢Βଟͯ͘ɺ શͯͷॲཧʹ͕͔͔࣌ؒΔ
ྔ͕ଟ͍ ϒϩάຊମͷδϣϒΩϡʔϫʔΧʔͷ ෛ୲Λߟ͑ͣʹɺಠཱͯ͠Ұؾʹ࣮ߦͰ͖Δ ॳظঢ়ଶ 63-͔Β ը૾औಘޭ 63-͔Β ը૾औಘࣦഊ Ϣʔβʔͷ (PPHMFೝূ
"1*Ͱ ը૾Λ୳͠த ը૾Λ୳͢ͷʹ ࣦഊ ީิ͕ू·ͬͨ ީิ͔Β ߜΓࠐΊͳ͍ ީิ͔Β ҰͭʹಛఆͰ͖ͨ ϑΥτϥΠϑʹ Ξοϓϩʔυத Ξοϓϩʔυ ࣦഊ Ξοϓϩʔυ ྃ هࣄͷॻ͖͑ ྃ هࣄͷॻ͖͑ ࣦഊ ϢʔβʔೝূҎલͷॲཧ Ұؾʹͬͯ͠·͑Δ &$4ͰཱͯͨίϯςφΛͬͯߦͬͨ
ྔ͕ଟ͍ (PPHMFϑΥτͷ"1*Λݺͼग़͢ճ͕ଟ͘ͳΔ ը૾σʔλΛ୳ͨ͢Ίͷ"1*ίʔϧ Ϣʔβʔͷʹൺྫͯ͠ଟ͘ͳΔͷͰɺ ͷ੍ݶճʹ͙ͨͬͯ͢͠·͏ɻ ॳظঢ়ଶ 63-͔Β ը૾औಘޭ 63-͔Β ը૾औಘࣦഊ
Ϣʔβʔͷ (PPHMFೝূ "1*Ͱ ը૾Λ୳͠த ը૾Λ୳͢ͷʹ ࣦഊ ީิ͕ू·ͬͨ ީิ͔Β ߜΓࠐΊͳ͍ ީิ͔Β ҰͭʹಛఆͰ͖ͨ ϑΥτϥΠϑʹ Ξοϓϩʔυத Ξοϓϩʔυ ࣦഊ Ξοϓϩʔυ ྃ هࣄͷॻ͖͑ ྃ هࣄͷॻ͖͑ ࣦഊ ͜͜
ྔ͕ଟ͍ ɾ"1*ݺͼग़͠ճ੍ݶͷ؇Λਃ ɾຖ্ݶʹͨΔ·Ͱݺͼग़ͯ͠ɺ ্ݶʹͨͬͨΒΓ࣍ͷҎ߱ʹճ͢
ਐḿ֬ೝ ์ஔ͍ͯͨ͠Βগͣͭ͠ॲཧ͕ਐΜͰ͍͘λΠϓͷ λεΫͳͷͰɺਐḿ֬ೝ͕େม SELECT COUNT(*) FROM image WHERE status =
‘…’; ͋ΔظؒͰͷਪҠΛάϥϑͰݟ͍ͨ .BDLFSFMͷग़൪ ͦΕͧΕͷঢ়ଶͷը૾͕ͲΕ͘Β͍͋Δͷ͔֬ೝ͍͚ͨ͠Ͳɺ ຖճ͜Μͳ͜ͱˣͨ͘͠ͳ͍
ͯͳͷαʔόʔࢹαʔϏε ه͍ͨ͠ΛαʔϏεϝτϦοΫ ͱͯ͠ఆظతʹ.BDLFSFMʹ ϙετ͢Δ ࠓճͳΒɺͦΕͧΕͷঢ়ଶͷ ը૾ͷຕ উखʹάϥϑԽͯ͘͠ΕΔ ਐḿ֬ೝ
.BDLFSFMͰμογϡϘʔυΛ࡞ͬͯຬ͍͚ͯͨ͠ΕͲʜ ผͷλεΫΛ͍ͬͯͨΒͪ͜Βͷॲཧ͕ ࢭ·ͬͯ͠·͍ͬͯͨ ࢭ·͍ͬͯΔͷʹ ؾ͚ͮΔΈ͕ඞཁ ਐḿ֬ೝ
.BDLFSFMͷʮࣜʹΑΔࢹʯ͕͑Δ UJNF4IJGU EJ⒎ ͳͲͷؔΛͬͯ ҰఆظؒͰͲΕ͘Β͍ਐΜ͔ͩΛԽ ͦΕ͕ҰఆҎԼʹͳͬͨΒΞϥʔτΛग़͢ ਐḿ֬ೝ diff( timeShift( ◦◦,
7d ), ◦◦ ) ࣜࢹͷྫ
ࣦഊͨ͜͠ͱ
ࣦഊͨ͜͠ͱ ݟੵΓ (PPHMFϑΥτͷ"1*ʹ͝ͱʹճ੍ݶ͕͋Δ ͦΕΛ͘ݟ͍ͯͨͷͰݟੵΓݟҧ͍ʹͳͬͯ͠·ͬͨ
ࣦഊͨ͜͠ͱ δϣϒೖ͗͢͠ δϣϒΩϡʔ DSPOδϣϒ ϒϩάͷ ΞϓϦέʔγϣϯ ϫʔΧʔ ϫʔΧʔ ϫʔΧʔ ͍Ζ͍Ζͳछྨͷ
δϣϒ͕ू·Δ ͜͜
ࣦഊͨ͜͠ͱ δϣϒೖ͗͢͠ δϣϒΩϡʔ͕ͲΕ͘Β͍Ͱࡹ͚Δ͔͋·ΓΘ͔ͬͯͳͯ͘ δϣϒΛೖΕ͗͢Δ ϒϩάͷଞͷδϣϒʹӨڹ ɾ༧ߘ ɾهࣄߘޙͷॲཧɹɹͳͲ
ࣦഊͨ͜͠ͱ use constant { JOB_COUNT = 20 }; σϓϩΠ͠ͳ͍ͱมߋͰ͖ͳ͍ ཧը໘ͱ͔Ͱαοͱ
มߋͰ͖ΔΑ͏ʹ͢Δ ճʹೖΕΔδϣϒͷ ద༻ ࡹ͚۩߹ʹΑͬͯௐͰ͖Δ
ֶΜͩ͜ͱ
ෳࡶͳλεΫ͔ͩΒͦ͜આ໌ஸೡʹ ϨϏϡϫʔʹ13ͷతҐஔ͚͕ͮͪΌΜͱΘΔͱɺ ߟྀ࿙ΕͷࢦఠɺΑΓΑ͍ํ๏ͷఏҊ Λͯ͠Β͑Δ͜ͱ͕͋Δ
ͯͳϒϩάͰѻ͏σʔλͷେ͖͞Λ࣮ײ ԿΛ͢Δʹ͕͔͔ͯ࣌ؒ͠ΔͷͰɺ ಠཱͯ͠ฒߦॲཧͰ͖Δ෦͢Δͷ͕େࣄ
طଘͷهࣄΛकΔ͜ͱ͕େ Ϣʔβʔͷࢿ࢈Ͱ͋ΔهࣄΛյ͞ͳ͍Α͏ʹ͢Δͷ͕ ࠷༏ઌ
Ҏ্Ͱ͢