WHY ARE DBAS SO GRUMPY ALL THE TIME - PostgreSQL · WHY ARE DBAS SO GRUMPY ALL THE TIME ? NORDIC...
Transcript of WHY ARE DBAS SO GRUMPY ALL THE TIME - PostgreSQL · WHY ARE DBAS SO GRUMPY ALL THE TIME ? NORDIC...
LOXODATA
@l_avrot
WHY ARE DBAS SO GRUMPYALL THE TIME ?
NORDIC PGDAY 2018-03-12
Lætitia AVROT Loxodata
LOXODATA
@l_avrot
WHO
Lætitia Avrot
PostgreSQL consultant and teacherDBA PostgreSQL for more than 10 years (and also Oracle and SQL Server)@l_avrot
LOXODATA
@l_avrot
LOXODATA
Company built on 3 essential pillars
PostgreSQL DevOps Cloud
LOXODATA
@l_avrot
Why are DBAs so grumpy all the time ?
Messing up from the beginningWorst developper's practicesOps can mess up too!
LOXODATA
@l_avrot
THE DESIGN
LOXODATA
@l_avrot
Remove potential interferences
Don't tell people about your projectDon't tell "ops" about your projectKeep your DBA busy (with production)
LOXODATA
@l_avrot
The more complex, the more fun!
Replication (multimaster, synchronous, logical...)Authentication (AD, LDAP)External data sources (Datalinks, FDW, ETL...)
LOXODATA
@l_avrot
Complexity by example
A simple websiteShows the company canteen menu each day
LOXODATA
@l_avrot
Complexity by example
Adding external authenticationAdding synchronous replicationAdding "0 administration architecture"Adding Backup and Monitoring tools
LOXODATA
@l_avrot
Complexity by example
Adding Elastic search for full text searchAdding data from old applicationAdding logical replication for BI App
LOXODATA
@l_avrot
Cost reduction
Mutualization50+ instances running on the same serverOne database per instance
LOXODATA
@l_avrot
Docker is the new black
Does everything!Composing ? What for ?Backing up ? What for ?
LOXODATA
@l_avrot
"Bad" docker by example
2 dockers on same VM1 PostgreSQL instance per containerWith streaming replication : call it hight availability!
LOXODATA
@l_avrot
APPLICATION DEVELOPMENT
LOXODATA
@l_avrot
ORMs
Let your ORM choose which model you needActivate indexing
LOXODATA
@l_avrot
Model
1st Normal FormDrop constraints, your app can handle it!Don't normalize : call it denormalization!
LOXODATA
@l_avrot
Be trendy : try schemaless!
Easier, faster, lighter!Mongo can do it!Store a lot : call it Big Data!You can fake a model too: Entity, Attribute, Value
LOXODATA
@l_avrot
Time series
Store current and archive data on same tableNo partitioning, of course!No purge ever : you need all your data!
LOXODATA
@l_avrot
Joins
Grab list of ids from �rst tableLoop on it and query on the second tableIf it's slow, blame the database!
LOXODATA
@l_avrot
Transactions, commits, locks and so on
Open transactions and leave it openAsk for explicit commit and never commitPostgres can't manage correct locks : use explicit locks!
LOXODATA
@l_avrot
OPS
LOXODATA
@l_avrot
Backups
Don't need (replication, disk miroring, VM snapshots)Only logicalHome made!No testing required
LOXODATA
@l_avrot
Monitoring
Graphs are for weaklings!Provide graphs without unit or legendTake one measure per day, it's quite enough!
LOXODATA
@l_avrot
"Cleaning" $PGDATA
pg_xlog/pg_walpg_cloguse pg_resetwal
LOXODATA
@l_avrot
RDBMS are magic!
No DBA neededNothing to understand: it's just magic!No maintenance needed!
LOXODATA
@l_avrot
Autovacuum
Setting it offautovacuum_*_scale_factor=0autovacuum_*_threshold=100000
LOXODATA
@l_avrot
Hide behind ITIL!
Strip the DBA off any permissionOne change per month, no more6-months validation process for a minor update
LOXODATA
@l_avrot
CONCLUSION
LOXODATA
@l_avrot
If you're a DBA...
Improve your communicationSmileAppease others
LOXODATA
@l_avrot
If you're not a DBA...
Improve your communicationSmileDon't let fear take control of you!
LOXODATA
@l_avrot
All we need is love!
: last friday of July : 256th day of the year
: �rst friday of July
Sysadmin appreciation dayDay of the ProgrammerDBA appreciation day
LOXODATA
@l_avrot
Questions ?
Thanks to Paul S Randall for the inspiration
Thanks to Freepik and Pixabay for illustrations and photos
LOXODATA
@l_avrot
Don't forget to leave feedbackhttps://2018.nordicpgday.org/feedback