Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Serverlessしかなかったので、ブラウザに働いてもらいました
Search
tanahiro2010
July 22, 2026
Programming
69
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Serverlessしかなかったので、ブラウザに働いてもらいました
https://serverlesslt.connpass.com/event/397581/
ここで登壇したやつ
tanahiro2010
July 22, 2026
More Decks by tanahiro2010
See All by tanahiro2010
東京で唐揚げを食べたら北海道の地理にたどり着いた件
tanahiro2010
0
23
Googleが発表した新Web標準ドラフト――WebMCP。実際どうなの? IO Extendedで実装・登壇して分かったこと
tanahiro2010
0
93
PHPの命名規則、結局camelCaseとsnake_caseどっちなんだ
tanahiro2010
0
31
Q. 底辺作家でも流行に乗れば舞えますか? A. はい。分析ランキング分析AIを使えば
tanahiro2010
1
71
OSSコミュニティがくれた「人との繋がり」
tanahiro2010
2
450
React Hooksを使いこなせ! ――初心者でも簡単。ポートフォリオ開発で実践するReact講座.pdf
tanahiro2010
0
24
SQLインジェクション ――攻撃の仕組みから対策まで
tanahiro2010
0
63
初心者でも簡単理解。Github講座
tanahiro2010
0
31
LLM AgentでTRPGを動かしたら、Agentの地獄を(多分)全部見た
tanahiro2010
1
150
Other Decks in Programming
See All in Programming
WebMCP Challenge に星空観察アプリで参加した話
okajun35
0
190
WebRTC映像をAirPlayに対応させる挑戦.pdf
monolithic_adam
0
300
IBM Bob Dojo #1 仕様駆動開発入門
oniak3ibm
PRO
0
170
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
0
170
Streamlitで実現する自然言語データアプリ開発
ayumu_yamaguchi
1
310
Heart of Swift Concurrency
koher
0
960
速く作れる。その次は、速く確かめられる開発へ 〜AIネイティブ開発を支える、Shift Down〜 / Can build fast. Next, moving to development where we can verify fast.
rkaga
5
4.3k
世界の中心で、AI(App Intents)をさけぶ ー App Intents中心設計の実践ガイド
touyou
0
650
個人開発基盤をまるごとCloudflareに引っ越して爆速で総合的体験を向上させた話
tinykitten
0
200
難しいけど、読めた。- OSSの入口に立った話。
sts11142
0
120
Building an Out-of-Order CPU
latte72
1
800
Family mrubyの進捗
kishima
1
130
Featured
See All Featured
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
320
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
700
Joys of Absence: A Defence of Solitary Play
codingconduct
1
530
Mind Mapping
helmedeiros
1
370
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
510
Visualization
eitanlees
152
17k
What's in a price? How to price your products and services
michaelherold
247
13k
Mobile First: as difficult as doing things right
swwweet
225
10k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.3k
A Soul's Torment
seathinner
8
3.6k
Ten Tips & Tricks for a 🌱 transition
stuffmc
1
240
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.3k
Transcript
Serverlessしかなかったので、ブラウザに働いても らいました PoWでランキングを守ってみた話 Serverless LT 1
自己紹介 田中博悠 / tanahiro2010 三田学園高等学校 1年生 TypeScript / Ruby Web
/ CLI 個人開発 OSSに少し貢献 小説も書く 2
皆さん 自分の謎のこだわりと 環境制限のせいで 暴走したこと、ありますか? 3
僕はあります ランキングを作りたかっただけなんです 4
作ったもの 「なんでも問題集」 匿名で問題を投げるサイト 技術 採用 Frontend Next.js Database Neon(PostgreSQL) Hosting
Vercel 全部サーバーレス 5
機能は素朴 誰でも匿名で 問題を作って投げる場所 問題の作成 公開 解く ランキング 力を入れたのは、解く場所とランキング つまり今回の本題。 6
問題 解かれた数ランキングを作りたい ぶっちゃけ、素直に増やすと死ぬ POST /solve 解いた扱い → while(true) fetch連打 →
ランキング終了 数字が壊れる APIだけだと弱い 7
どうする? ログイン? CAPTCHA? Turnstile? Rate Limit? どれも重い 8
サーバーレスの縛り 重い処理は無理 CPU時間が怖い DB直撃も怖い 課金も怖い でもログインは嫌 9
現実はもっと泥 起動待ちに怯える 権限設定で詰む ログ追跡がつらい 課金グラフを見る 夜中に眉間が寄る 10
結論 ブラウザに働かせる 11
以前Discord Botで PoWを書いた記憶が蘇った。 PoWで殴る 12
全体の流れ Browser お題を取る → PoW計算 nonce探し → Verify 結果を投げる →
Server検証 一瞬で見る → ランキング更 新 通れば加算 13
Challenge取得 GET /api/works/:id/challenges 返すもの prefix token(JWT) 端末で難易度を変える PC スマホ 14
検証 POST /api/works/:id/challenges/:challengeId 送信 nonce / token → サーバーで検証 条件だけ見る
→ ランキング更新 成功だけ反映 15
完璧? UA偽装 Bot突破 端末判定は雑 本気の攻撃は無理 でも、今回の狙いは 大量送信のコストを上げる ここだけ。 もちろん穴はある 16
PoWを書きたかった 実は…… これが理由の半分くらい。 個人開発だからこそ 「面白そう」 で突っ込めるのが最高。 17
サーバーレスだから 「できない」 ではなく どう実現する? 18
ご清聴ありがとうございました GitHub・質問などぜひ 19