Are you running a Database in the cloud? Worried that you’re doing it wrong?
Engine Yard supports a broad set of databases, with lots of
flexibility for customers to modify and configure their installations. But the freedom to adapt and extend standard functionality comes at the risk of unexpected negative consequences: seemingly benign modifications can seriously affect durability and performance.
During our years of helping customers, I've had the unique opportunity to observe common problems, patterns, and best practices with big (and not so big) data. In this talk I'll highlight the most common pitfalls and tell you how to avoid them (I will most likely rant about other things too!).
http://www.meetup.com/nycdevops/events/181986002/
22. RDBMS for
Session
Data
Anti-Pattern #5 Often means at least
one write per request
Any DB issue/task may
cause app to hang
Tables have a
tendency to bloat
33. Anti-Pattern #10
Storage is
the same
Instance storage is
not persisted (unless
you use EBS)
Data locality matters
Don’t run your cloud
DBs too hot!
34. Doing cloud right
Know your
cloud
deployments
Replication in the
cloud is a must-have
Put DB master
replicas in different
AZs
35. Doing cloud right
Learn high
availability
disaster
recovery
Get good at replica
promotions (some
work involved)
Understand and
invest in DR/HA.
Know your options
36. Doing cloud right
Know your
system
Invest in monitoring
Know your data
distribution
querying patterns
Know baseline
behavior
38. Boring Definition #2
Indexes
(or indices, I prefer indexes)
Improves speed of
data retrieval
Used in random
ordered lookups
Imply additional
writes storage
41. Doing Indexes right
Many index
types
Many types. Learn
how your DB does
them.
You want the right
amount.
42. Doing Indexes right
Postgres
Indexes
summarized
B-TR EE S
D E FAULT. NU MER IC,
TE XT, NU LL
HA SH
EQUA L I T Y. D ON’ T USE
G IN
A RRAY VA LUE S F TS
G I ST
GEOME TRIC DATA F TS
They Can Be
Created
Concurrently!
43. Doing Indexes right
Postgres
Indexes are
more baller
P A R TIA L INDEXE S
I NDE X + WHERE C LAUSE
EX PRE SS I O N I ND E XE S
M AT C H O N FUNC TI ON/
M OD I F IC ATI ON
UNI QUE IN DE XE S
PRE V E N T S DU PE S
SOR TED I ND EXE S
A LTE R B-TRE E FR OM A S C TO
DE SC
44. Prioritize them, take them
regularly. For the love of
sweet baby jesus routinely
test them
Backups
Know a DBs use case,
strengths, weaknesses
How well does it fit your
needs?
Choices
tl;dr;
Have the right amount.
Properly maintain them.
DB Indexes
Not the same as real
hardware. Plan for
failures.
The Cloud