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
David Dahl
March 04, 2013
Programming
1
96
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
470
Other Decks in Programming
See All in Programming
try!Swift Tokyo 2024 参加報告 LT
akidon0000
1
190
if constexpr文はテンプレート世界のラムダ式である
faithandbrave
0
190
TYPO3 v13 – The road to LTS: What's new and new APIs
luisasofie_xoxo
0
180
CQRS/ES avec Symfony, c’est (trop) bien !
jeremyfreeagent
1
630
puregoの活用例
aethiopicuschan
0
220
コーンフレークから始める モデリング会話入門
ogurotakayuki
0
280
脱・初心者!脱・マネコン!AWS CDKを使ってみませんか!?
har1101
0
300
AWS Application Composerで始める、 サーバーレスなデータ基盤構築 / 20240406-jawsug-hokuriku-shinkansen
kasacchiful
1
250
StreamlitとTerraformでデータカタログを作った話
gussan0223
0
300
受託開発でGitLab CI を活用していく
xiombatsg
1
270
スキーマ駆動開発による品質とスピードの両立 - 私達は何故、スキーマを書くのか
kentaroutakeda
0
130
Semantic search with Django and pgvector
pauloxnet
0
240
Featured
See All Featured
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
19
1.9k
Rebuilding a faster, lazier Slack
samanthasiow
72
8.2k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
115
18k
Building Applications with DynamoDB
mza
88
5.6k
Intergalactic Javascript Robots from Outer Space
tanoku
266
26k
Teambox: Starting and Learning
jrom
128
8.4k
Gamification - CAS2011
davidbonilla
76
4.6k
RailsConf 2023
tenderlove
2
530
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
34
8.9k
Building Adaptive Systems
keathley
30
1.8k
For a Future-Friendly Web
brad_frost
171
8.9k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
154
14k
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]