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
NoSQL: Not Only a Fairy Tale
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Sebastian Cohnen
May 30, 2012
Technology
4
14k
NoSQL: Not Only a Fairy Tale
Talk of Timo Derstappen and me at the NoSQL Matters conference in 2012
Sebastian Cohnen
May 30, 2012
Tweet
Share
More Decks by Sebastian Cohnen
See All by Sebastian Cohnen
The Life of a Load Generator
tisba
0
840
Load Testing with 1M Users
tisba
2
3k
Performance Testing Serverless
tisba
0
160
Performance Testing 101, code.talks commerce 2018 [DE]
tisba
2
440
Why we did not choose Microservices to replace a Legacy System
tisba
1
150
Performance Testing 101 [DE]
tisba
0
130
Load Testing with 1,000,000 Users!
tisba
0
200
code.talks 2016: Last- und Performancetests in der Cloud [DE]
tisba
1
940
FrOSCon 2016: Last- und Performancetests in der Cloud?! [DE]
tisba
0
370
Other Decks in Technology
See All in Technology
制約が導く迷わない設計 〜 信頼性と運用性を両立するマイナンバー管理システムの実践 〜
bwkw
3
1k
プロダクト成長を支える開発基盤とスケールに伴う課題
yuu26
4
1.4k
Embedded SREの終わりを設計する 「なんとなく」から計画的な自立支援へ
sansantech
PRO
3
2.6k
20260208_第66回 コンピュータビジョン勉強会
keiichiito1978
0
190
モダンUIでフルサーバーレスなAIエージェントをAmplifyとCDKでサクッとデプロイしよう
minorun365
4
220
マネージャー視点で考えるプロダクトエンジニアの評価 / Evaluating Product Engineers from a Manager's Perspective
hiro_torii
0
160
コンテナセキュリティの最新事情 ~ 2026年版 ~
kyohmizu
6
1.1k
生成AIと余白 〜開発スピードが向上した今、何に向き合う?〜
kakehashi
PRO
0
130
usermode linux without MMU - fosdem2026 kernel devroom
thehajime
0
240
【Ubie】AIを活用した広告アセット「爆速」生成事例 | AI_Ops_Community_Vol.2
yoshiki_0316
1
120
Claude_CodeでSEOを最適化する_AI_Ops_Community_Vol.2__マーケティングx_AIはここまで進化した.pdf
riku_423
2
610
Cloud Runでコロプラが挑む 生成AI×ゲーム『神魔狩りのツクヨミ』の裏側
colopl
0
130
Featured
See All Featured
GraphQLとの向き合い方2022年版
quramy
50
14k
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
Navigating Team Friction
lara
192
16k
The Curse of the Amulet
leimatthew05
1
8.7k
How to make the Groovebox
asonas
2
1.9k
Claude Code のすすめ
schroneko
67
210k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
310
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Paper Plane (Part 1)
katiecoart
PRO
0
4.3k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Heart Work Chapter 1 - Part 1
lfama
PRO
5
35k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
190
Transcript
NoSQL Not only a fairy tale Sebastian Cohnen @tisba tisba.de
Timo Derstappen @teemow adcloud.com http://en.wikipedia.org/wiki/File:Old_book_-_Timeless_Books.jpg
Preface
Terms • placement & ads • ad priority
System Overview • administrative back office • worker queue •
almost no NoSQL • serving ads • tracking • here be NoSQLs! platform adserver publishing ads & placements stats & tracking data
Once upon a time… …way back in 2008
Simple Storage Service
Publishing to S3 • gather ad & placement data •
add some JavaScript • publish everything to S3
Ad Delivery via S3 • user visits a website •
deliver JavaScript via CDN • choose and display ads
but, • publishing to S3 was rather expensive • no
incremental update of denormalized data
The relaxed Knight …came along in 2009
CouchDB • REST & JavaScript? nice! • M/R Views •
Multi-Master setup platform adserver adserver adserver
CouchDB only • normalize the data (a bit) • split
by update frequency • BUT… n-m relations are hard to model • and persistent, incremental views are rather useless to us
:-(
CouchDB + node.js • use node.js to assemble data (n-m
relation) • cache response using nginx • also cache some data in node.js
Request flow • incoming request • nginx cache miss •
fetch placement & priorities • process data & fetch ads • send response
How to monitor Consistency? • write tracer documents • measure
replication delay
Achievements • reduced turnaround for publishing priorities by >50% •
build foundation for new features
New Feature Requests …ahead in early 2011
The Problem • requests eventually are going to be unique
• therefor less requests can be cached • CouchDB too slow for our needs • caching things within a node.js process was a bad idea too
Redis • during a cache warmup phase we pre-fill redis
with placement and ad data • all live request are served out of redis • data is updated in the background
…in late 2011 Scalability
How we used CouchDB • >10k updates/h • single source
of changes • multi-master replication • append-only • durability • MVCC usage not required
Resulting Issues • problems with replication and high load •
more instances, more replication, even more load • compaction was a pain too
Whose fault? • not only CouchDB’s fault • simply the
wrong use case • one source for updates • no need for append-only reliability
What now?
Back to S3! • with Redis caching in place… •
move placement and ad data to S3 • cache warming upfront and background updates work just fine!
S3 vs CouchDB • S3 simply fits our needs •
no need to implement sync checks or run compaction • fewer moving parts • less state on our application servers
Once again, more features …ahead in early 2012
Status Quo • first S3-based “adserver” did the ad selection
on the client side • to a certain degree this is still the case
The Challenge • prepare the systems for Real-time bidding •
enable the adserver to decide ad selection server-side • do it fast, say within 25ms or less
Remember Redis? • we know and trust Redis’ performance •
it has sorted sets • we have sets of ads to display for a placement Eureka!
Redis Reloaded! • heavily use sorted sets • create sets
of ads… • we can choose from • which cannot be displayed at all • use ZUNIONSTORE & ZRANGEBYSCORE to precisely select ads
Redis Reloaded! • Redis became a deeply integrated part of
the core business logic • it was very easy to model our needs with Redis • besides enabling new features, we reduced the response payload by >75%
Conclusion
• try to go as incremental as possible • drivers
for architectural decisions… • features • quality & performance • scalability What worked for us…
The End!
• Questions (if time permits) • Visit us at the
adcloud booth Sebastian Cohnen @tisba tisba.de Timo Derstappen @teemow adcloud.com The End!