際際滷

際際滷Share a Scribd company logo
@smathieurainforest
Deployment:!
tips and tricks
@smathieurainforest
Why?
Deployments are scary
Major cause of downtime
Wasted time
@smathieurainforest
About
@smathieu
Rails meetup   deployments tricks
We only deploy 20 times per day
@smathieurainforest
Tip #1
@smathieurainforest
@smathieurainforest
Tip #2
@smathieurainforest
Have a staging server
rainforest @smathieu
@smathieurainforest
Tip #3
@smathieurainforest
@smathieurainforest
Tip #4
@smathieurainforest
Deploying Without Downtime
@smathieurainforest
Migrations
Major challenge to get right
It gets harder with data
@smathieurainforest
ActiveRecords Column Cache
@smathieurainforest
@smathieurainforest
Dont delete columns
rename_column :users, :notes, :deprecated_notes
_2014_01_01
@smathieurainforest
Adding Indexes
Slows on large tables
Locks the table
@smathieurainforest
Postgres
CREATE INDEX CONCURRENTLY
@smathieurainforest
MySQL
Percona Toolkit:
http://www.percona.com/software/percona-toolkit
Facebooks Online Schema Change:
https://www.facebook.com/notes/mysql-at-
facebook/online-schema-change-for-mysql/
430801045932
@smathieurainforest
Renaming Columns
Dont do it
@smathieurainforest
@smathieurainforest
Tip #5
@smathieurainforest
Having a staging server is
nice, but
@smathieurainforest
 on demand staging is
better
Rails meetup   deployments tricks
@smathieurainforest
And many more
@smathieurainforest
Conclusion
Your CI should be the only thing deploying your
code
No-Downtime Deployments are harder, but
possible
Invest in your deployment processes
rainforest @smathieu
Questions?
@smathieurainforest
Links
https://github.com/jipiboily/fourchette
https://www.facebook.com/notes/mysql-at-facebook/online-
schema-change-for-mysql/430801045932
http://www.percona.com/software/percona-toolkit

More Related Content

Rails meetup deployments tricks