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
Cloudflare Workersのデータストア、KVとD1を比較してみる / Cloud...
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
shiro seike
PRO
July 22, 2023
Programming
0
840
Cloudflare Workersのデータストア、KVとD1を比較してみる / Cloudflare Workers datastore, comparing KV and D1.
Cloudflare Meetup Oita Kick off!!
https://cfm-cts.connpass.com/event/285212/
shiro seike
PRO
July 22, 2023
Tweet
Share
More Decks by shiro seike
See All by shiro seike
歴史から学ぶ「Why PHP?」 PHPを書く理由を改めて理解する / Learning from History: “Why PHP?” Rediscovering the Reasons for Writing PHP
seike460
PRO
0
340
Team-First Serverless Platform Engineering Approach to PHP Applications with Laravel and Bref
seike460
PRO
0
55
なぜ適用するか、移行して理解するClean Architecture 〜構造を超えて設計を継承する〜 / Why Apply, Migrate and Understand Clean Architecture - Inherit Design Beyond Structure
seike460
PRO
3
980
生成AIコーディングとの向き合い方、AIと共創するという考え方 / How to deal with generative AI coding and the concept of co-creating with AI
seike460
PRO
1
480
地方のPHPerもクラウドを使う理由 ~コストの最適化とチームに向き合う~ / Why even local PHPers use the cloud ~optimize costs and face the team
seike460
PRO
0
93
OpenTelemetryで始めるベンダーフリーなobservability / Vendor-free observability starting with OpenTelemetry
seike460
PRO
0
240
AIコーディングの本質は“コード“ではなく“構造“だった / The essence of AI coding is not “code” but "structure
seike460
PRO
2
1.3k
OpenTelemetryを活用したObservability入門 / Introduction to Observability with OpenTelemetry
seike460
PRO
2
1k
Amazon Q Developer Proで効率化するAPI開発入門
seike460
PRO
0
500
Other Decks in Programming
See All in Programming
Smart Handoff/Pickup ガイド - Claude Code セッション管理
yukiigarashi
0
140
Best-Practices-for-Cortex-Analyst-and-AI-Agent
ryotaroikeda
1
110
KIKI_MBSD Cybersecurity Challenges 2025
ikema
0
1.3k
AIフル活用時代だからこそ学んでおきたい働き方の心得
shinoyu
0
140
コントリビューターによるDenoのすゝめ / Deno Recommendations by a Contributor
petamoriken
0
200
AI時代の認知負荷との向き合い方
optfit
0
160
15年続くIoTサービスのSREエンジニアが挑む分散トレーシング導入
melonps
2
220
HTTPプロトコル正しく理解していますか? 〜かわいい猫と共に学ぼう。ฅ^•ω•^ฅ ニャ〜
hekuchan
2
690
CSC307 Lecture 05
javiergs
PRO
0
500
Raku Raku Notion 20260128
hareyakayuruyaka
0
340
高速開発のためのコード整理術
sutetotanuki
1
400
CSC307 Lecture 06
javiergs
PRO
0
690
Featured
See All Featured
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
1
1.4k
Docker and Python
trallard
47
3.7k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
150
The Art of Programming - Codeland 2020
erikaheidi
57
14k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
730
4 Signs Your Business is Dying
shpigford
187
22k
Evolving SEO for Evolving Search Engines
ryanjones
0
130
Building Applications with DynamoDB
mza
96
6.9k
Stop Working from a Prison Cell
hatefulcrawdad
273
21k
Testing 201, or: Great Expectations
jmmastey
46
8k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
66
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
190
Transcript
Cloudflare Workers KV D 1 Cloudflare Meetup Oita Kick
off!! 2 0 23 . 07 . 22 @seike 4 60 1
@seike 460 - - @seike 46 0 - Fusic -
/ - / - - Cloudflare Meet-up Fukuoka Organizer - ServerlessDays 20 23 Organizer - JAWS Festa 2023 Staff 2
Agenda 1 .Cloudflare Workers 2 .Cloudflare Workers KV 3 .Cloudflare
D 1 4 .Workers KV D 1 5 .Workers KV D 1 3
01 Cloudflare Workers
Cloudflare Workers Workers Cloudflare Web Workers Cloudflare Developer
Platform 5
02 Cloudflare Workers KV
Cloudflare Workers KV Key-Value 275 Key-Value
7
03 Cloudflare Workers KV
Cloudflare Workers D 1 D 1 Cloudflare D 1 SQLite
SQL Web 9
04 Workers KV D 1
11 GA I/F Wokers 1 10 JS - KV 1
10 1 1,000 Key-Value ? D 1 Read units 5 million / day Write units 100 , 00 0 / day SQL ? 10 KV 1000 ? ? ?
None
05 Workers KV D 1
KV 14 export const getPresentationsKV = async (KV: KVNamespace): Promise<string
| null> => { const startTimePut = performance.now(); for (let i = 0; i < 100; i++) { await KV.put(i.toString(), i.toString()); } const endTimePut = performance.now(); let putTime = endTimePut - startTimePut; for (let i = 0; i < 100; i++) { const value = await KV.get(i.toString()); } const endTimeGet = performance.now(); const getTime = endTimeGet - endTimePut; return 'putTime: ' + putTime + ' - getTime: ' + getTime; };
D 1 15 export const getPresentation = async (DB: D1Database,
id: string): Promise<Presentation | undefined> => { await DB.prepare('DELETE FROM Presentations').run(); const startTimePut = performance.now(); for (let i = 0; i < 100; i++) { await DB.prepare('INSERT INTO Presentations (id) VALUES (?)’) .bind(i.toString()).run(); } const endTimePut = performance.now(); let putTime = endTimePut - startTimePut; for (let i = 0; i < 100; i++) { const value = await DB.prepare('SELECT id FROM Presentations WHERE id = ?') .bind(i.toString()) .first(); } const endTimeGet = performance.now(); const getTime = endTimeGet - endTimePut; const newPresentation: Presentation = { name: 'putTime: ' + putTime + ' - getTime: ' + getTime, }; return newPresentation; };
KV Insert putTime --------- 2 34 2 6 getTime ---------
1 22 2 KV Update putTime --------- 2 37 6 3 getTime --------- 1 25 4 D 1 putTime --------- 1 98 3 2 getTime --------- 1 53 8 5 16
Point KV D 1 D 1 β
Serverless Days Tokyo 2023 18
Thank You We are Hiring ! https://recruit.fusic.co.jp/