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 - getting over the bad parts
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
David Dahl
March 04, 2013
Programming
1
120
Nosql - getting over the bad parts
Talk held at Scandinavian Developer Conference in Gothenburg
David Dahl
March 04, 2013
Tweet
Share
More Decks by David Dahl
See All by David Dahl
Building a real time analytics engine in JRuby
effata
1
530
Other Decks in Programming
See All in Programming
The Ralph Wiggum Loop: First Principles of Autonomous Development
sembayui
0
3.7k
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
370
猫の手も借りたい!ので AIエージェント猫を作って社内に放した話 Claude Code × Container Lambda の Slack Bot "DevNeko"
naramomi7
0
260
Codex の「自走力」を高める
yorifuji
0
1.2k
LangChain4jとは一味違うLangChain4j-CDI
kazumura
1
170
Go 1.26でのsliceのメモリアロケーション最適化 / Go 1.26 リリースパーティ #go126party
mazrean
1
380
nilとは何か 〜interfaceの構造とnil!=nilから理解する〜
kuro_kurorrr
3
1.9k
AIとペアプロして処理時間を97%削減した話 #pyconshizu
kashewnuts
1
220
go directiveを最新にしすぎないで欲しい話──あるいは、Go 1.26からgo mod initで作られるgo directiveの値が変わる話 / Go 1.26 リリースパーティ
arthur1
2
530
Rで始めるML・LLM活用入門
wakamatsu_takumu
0
170
最初からAWS CDKで技術検証してもいいんじゃない?
akihisaikeda
4
120
CDIの誤解しがちな仕様とその対処TIPS
futokiyo
0
200
Featured
See All Featured
Testing 201, or: Great Expectations
jmmastey
46
8.1k
Crafting Experiences
bethany
1
81
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
480
Music & Morning Musume
bryan
47
7.1k
Code Review Best Practice
trishagee
74
20k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.1k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
150
Scaling GitHub
holman
464
140k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
190
So, you think you're a good person
axbom
PRO
2
1.9k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
300
Raft: Consensus for Rubyists
vanstee
141
7.4k
Transcript
“nosql” Getting over the bad parts David Dahl @effata
Rant
Overview ‣ Real life lessons ‣ Production systems ‣ Write
heavy ‣ MongoDB ‣ Redis ‣ Cassandra
generic ‣ Took a DB class? - Forget everything you
learned! ‣ Denormalize all the things - Up to a limit ‣ Consistency is your responsibility ‣ Primary keys - Give them a lot of thought
None
{ "_id" : ObjectId("51235a80472689978000004e"), "access" : { "admin": ['some_app'], "deep_access":
{ "another_level": 1 } }, "apps" : [ 'some_app', 'some_other_app' ], "created_at" : ISODate("2012-07-23T13:31:17Z"), "email" : "
[email protected]
", "state" : "active" }
Default behaviour Reckless writes
Brutally Slow Object Notation
Quite the complex beast Sharding
Global Write Lock Really? ... Actually, not anymore.
Deleting stuff
Good stuff ‣ Replication - It just works, and it
works REALLY well - rs.init(), rs.add(“second.node”) ‣ Schemaless + secondary indexes - Add whatever, query however ‣ Javascript CLI - db.find({name: “Clive”, birthdate: {$gte: ISODate(“1975-05-01”)}})
None
‘some/arbitary/key’ => ‘string’ {‘single_level’: ‘hash’} [‘list’, ‘of’, ‘items’] Set(‘a’, ‘b’)
Moar memory! In memory database
Single threaded a.k.a That 30s list command i just ran
blocked the entire production system (that totally never happened)
Persistance ‣ RDB - point in time snapshot - Entire
process forks. - Enable overcommit memory! ‣ AOF - write log - Very slow on startup ‣ AOF has higher priority on startup - Enable at runtime or loose stuff ‣ Monitor your log files!
No clustering ‣ Only master-slave replication - No failover ‣
Redis sentinel - promising but not ready ‣ Redis cluster - unstable/”not production ready” ‣ Twemproxy
Good stuff ‣ Wicked fast - To a limit ‣
Deletion - not a problem ‣ TTL - on key level
None
row_key column_1 column_2 column_3 row_key value value value row_key column_1
column_4 row_key value value
Dynamo By Amazon Not to be confused with DynamoDB -
by Amazon
Black magic Or maybe I’m just dumb
Extremely java centric Some of you might think thats a
good thing... 1.2 and CQL3 makes things a lot better
Data modeling Spend a lot of time on it!
“No” indexes Secondary indexes only good for low uniqueness (make
your own)
Good stuff ‣ Black magic - Complex, but well made
‣ TTL on rows and columns ‣ Writes scale linearly “to infinity” - Netflix benchmarked 1 million writes/s (EC2)
Thank you @effata
[email protected]