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
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
820
Load Testing with 1M Users
tisba
2
2.9k
Performance Testing Serverless
tisba
0
130
Performance Testing 101, code.talks commerce 2018 [DE]
tisba
2
420
Why we did not choose Microservices to replace a Legacy System
tisba
1
140
Performance Testing 101 [DE]
tisba
0
110
Load Testing with 1,000,000 Users!
tisba
0
190
code.talks 2016: Last- und Performancetests in der Cloud [DE]
tisba
1
900
FrOSCon 2016: Last- und Performancetests in der Cloud?! [DE]
tisba
0
350
Other Decks in Technology
See All in Technology
AIエージェント時代のエンジニアになろう #jawsug #jawsdays2025 / 20250301 Agentic AI Engineering
yoshidashingo
9
4.2k
Aurora PostgreSQLがCloudWatch Logsに 出力するログの課金を削減してみる #jawsdays2025
non97
1
250
OPENLOGI Company Profile for engineer
hr01
1
20k
入門 PEAK Threat Hunting @SECCON
odorusatoshi
0
180
OCI Success Journey OCIの何が評価されてる?疑問に答える事例セミナー(2025年2月実施)
oracle4engineer
PRO
2
220
開発者体験を定量的に把握する手法と活用事例
ham0215
0
140
20250304_赤煉瓦倉庫_DeepSeek_Deep_Dive
hiouchiy
2
130
完璧を捨てろ! “攻め”のQAがもたらすスピードと革新/20250306 Hiroki Hachisuka
shift_evolve
0
110
ディスプレイ広告(Yahoo!広告・LINE広告)におけるバックエンド開発
lycorptech_jp
PRO
0
610
30→150人のエンジニア組織拡大に伴うアジャイル文化を醸成する役割と取り組みの変化
nagata03
0
360
JAWS FESTA 2024「バスロケ」GPS×サーバーレスの開発と運用の舞台裏/jawsfesta2024-bus-gps-serverless
ma2shita
3
370
サイト信頼性エンジニアリングとAmazon Web Services / SRE and AWS
ymotongpoo
7
1.9k
Featured
See All Featured
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Mobile First: as difficult as doing things right
swwweet
223
9.5k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5.3k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
233
17k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
27
1.6k
Java REST API Framework Comparison - PWX 2021
mraible
29
8.4k
Large-scale JavaScript Application Architecture
addyosmani
511
110k
Writing Fast Ruby
sferik
628
61k
GraphQLの誤解/rethinking-graphql
sonatard
69
10k
Optimizing for Happiness
mojombo
377
70k
Testing 201, or: Great Expectations
jmmastey
42
7.2k
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!