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
14k
4
Share
NoSQL: Not Only a Fairy Tale
Talk of Timo Derstappen and me at the NoSQL Matters conference in 2012
Sebastian Cohnen
May 30, 2012
More Decks by Sebastian Cohnen
See All by Sebastian Cohnen
The Life of a Load Generator
tisba
0
860
Load Testing with 1M Users
tisba
2
3k
Performance Testing Serverless
tisba
0
170
Performance Testing 101, code.talks commerce 2018 [DE]
tisba
2
450
Why we did not choose Microservices to replace a Legacy System
tisba
1
170
Performance Testing 101 [DE]
tisba
0
150
Load Testing with 1,000,000 Users!
tisba
0
210
code.talks 2016: Last- und Performancetests in der Cloud [DE]
tisba
1
950
FrOSCon 2016: Last- und Performancetests in der Cloud?! [DE]
tisba
0
380
Other Decks in Technology
See All in Technology
AIが変えた"品質の守り方"
kkakizaki
13
5.5k
GitHub Copilot CLIでWebアクセシビリティを改善した話
tomokusaba
0
140
「気づいたら仕事が終わっている」バクラクAIエージェント本番運用の裏側 / layerx-bakuraku-aie2026
yuya4
6
2.6k
もりもり新機能を一挙紹介! AgentCoreに入門して、AWS上にAIエージェントを構築しよう
minorun365
PRO
6
610
サプライチェーンセキュリティの空白地帯 - 信頼できる”依存性”の未来を考える
rung
PRO
2
610
React、まだ楽しくて草
uhyo
7
3.7k
エンジニアは生成AIと どのように向き合うべきか? ことばの意味という観点から
verypluming
3
310
電子辞書Brainをネットに繋げてみた(自力編)
raspython3
0
400
新規ゲーム開発におけるAI駆動開発のリアル
202409e2
0
720
Databricks 月刊サービスアップデート 2026年05月号
tyosi1212
0
180
Claude code Orchestra
ozakiomumkj
3
860
【Gen-AX】20260530開催_JJUG CCC 2026 Spring
genax
0
280
Featured
See All Featured
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
150
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
180
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.4k
Documentation Writing (for coders)
carmenintech
77
5.4k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.8k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Everyday Curiosity
cassininazir
0
220
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
160
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
130
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
62
54k
Side Projects
sachag
455
43k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
10k
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!