the comeback of migrations-based deployments - dan nolan & elizabeth ayer

25
The Comeback of Migrations-based deployments Dan Nolan & Elizabeth Ayer Redgate #SQLintheCityUK

Upload: red-gate-software

Post on 15-Apr-2017

314 views

Category:

Software


1 download

TRANSCRIPT

Page 1: The Comeback of Migrations-based deployments - Dan Nolan & Elizabeth Ayer

The Comeback of

Migrations-based deployments

Dan Nolan & Elizabeth Ayer

Redgate

#SQLintheCityUK

Page 2: The Comeback of Migrations-based deployments - Dan Nolan & Elizabeth Ayer

Goals

• Examine migration’s poor cousin: the manual change script

• What is ReadyRoll? How does it fit in at Redgate?

• Address two key myths of migrations-based development

#SQLintheCityUK

Page 3: The Comeback of Migrations-based deployments - Dan Nolan & Elizabeth Ayer

#SQLintheCityUK

What is a migration?

Page 4: The Comeback of Migrations-based deployments - Dan Nolan & Elizabeth Ayer

#SQLintheCityUK

The manual change script:Migration’s poor cousin

Page 5: The Comeback of Migrations-based deployments - Dan Nolan & Elizabeth Ayer

JimDatabase

Developer

BobDBA

ChrisDevelopment

Manager

ElaineApplicationDeveloper

Page 6: The Comeback of Migrations-based deployments - Dan Nolan & Elizabeth Ayer

Jim

Change to Account table – ticket #42743

Hi Jim,

Could you add a new column to the Account table? See ticket #42743 for

the details of the change.

Let me know if you have any questions.

Regards

Elaine

ElaineApplicationDeveloper

Page 7: The Comeback of Migrations-based deployments - Dan Nolan & Elizabeth Ayer

20150912_Add_Column_42743.sql

JimDatabaseDeveloper

Elaine

Re: Change to Account table – ticket #42743

Hi Elaine,

I’ve attached the change script to accompany the code changes for ticket

#42743. It needs to checked in as part of the same commit.

Thanks!

Jim

Page 8: The Comeback of Migrations-based deployments - Dan Nolan & Elizabeth Ayer

Jim

Change to Account table – ticket #42743

Hi Jim,

Thanks. I’ll add the script to our next release.

Regards

Elaine ElaineApplicationDeveloper

Page 9: The Comeback of Migrations-based deployments - Dan Nolan & Elizabeth Ayer

Elaine; Jim; Bob

URGENT: Application not accepting new users

QA just told me that the application won’t let them add new users to the

system. We’re waiting on this release to go out the door ASAP. Can we

get to the bottom of this?

Chris

Development Manager

ChrisDevelopment

Manager

Page 10: The Comeback of Migrations-based deployments - Dan Nolan & Elizabeth Ayer

Chris; Jim; Bob

Re: URGENT: Application not accepting new users

Hi all,

Looks like the database change script didn’t get promoted alongside the

application change.

Bob: Could you run the attached script?

Elaine ElaineApplicationDeveloper

20150912_Add_Column_42743.sql

Page 11: The Comeback of Migrations-based deployments - Dan Nolan & Elizabeth Ayer

Chris; Jim; Bob

Re: URGENT: Application not accepting new users

Hi Elaine, Jim,

Looking through the script it all looks good except I don’t understand why

we’re dropping and adding an index as part of this change? Jim, could

you explain?

Cheers

BobBobDBA

Page 12: The Comeback of Migrations-based deployments - Dan Nolan & Elizabeth Ayer

JimDatabaseDeveloper

Bob; Elaine; Chris

Re: Change to Account table – ticket #42743

Hi Bob,

We need to do this for complicated technical reasons. I’ll come speak to

you in person…

Thanks

Jim

Page 13: The Comeback of Migrations-based deployments - Dan Nolan & Elizabeth Ayer

Chris; Jim; Bob

Re: URGENT: Application not accepting new users

Hi all,

Changed deployed. Ready for testing…

Cheers

Bob BobDBA

Page 14: The Comeback of Migrations-based deployments - Dan Nolan & Elizabeth Ayer

Elaine; Jim; Bob

URGENT: Application not accepting new users

Guys…!

Can we find some way of making this process less likely to screw up?!?

Regards

Chris

Development Manager ChrisDevelopment

Manager

Page 15: The Comeback of Migrations-based deployments - Dan Nolan & Elizabeth Ayer

#SQLintheCityUK

What is ReadyRoll?

A Visual Studio extension which makes it easy to develop and deploy SQL Server databases

Page 16: The Comeback of Migrations-based deployments - Dan Nolan & Elizabeth Ayer

Top Myths

Page 17: The Comeback of Migrations-based deployments - Dan Nolan & Elizabeth Ayer

Collaboration is difficult

“Migrations don’t work in agile teams.”

Releases are error-prone

“There’s always issues with scripts when we deploy to Prod.”

Page 18: The Comeback of Migrations-based deployments - Dan Nolan & Elizabeth Ayer

Team Collaboration Demo#SQLintheCityUK

Page 19: The Comeback of Migrations-based deployments - Dan Nolan & Elizabeth Ayer

SSMS Visual Studio

BobDBA

JimDeveloper

Visual Studio

Source Control

(Git)

Page 20: The Comeback of Migrations-based deployments - Dan Nolan & Elizabeth Ayer

ReadyRoll enables state-like deployment for stateless objects, and uses migrations for everything else.

Page 21: The Comeback of Migrations-based deployments - Dan Nolan & Elizabeth Ayer

Deployment Demo#SQLintheCityUK

Page 22: The Comeback of Migrations-based deployments - Dan Nolan & Elizabeth Ayer

Octopus Deploy

BobDBA

Source Control (Git) TeamCity

Page 23: The Comeback of Migrations-based deployments - Dan Nolan & Elizabeth Ayer

Through its build-once, deploy many timesapproach, ReadyRoll allows teams to achieve

consistent and predictable database releases.

Page 24: The Comeback of Migrations-based deployments - Dan Nolan & Elizabeth Ayer

Want to try the tools you’ve just seen?Head to the Hands-on Labs

#SQLintheCityUK

Page 25: The Comeback of Migrations-based deployments - Dan Nolan & Elizabeth Ayer

Get in touch

ready-roll.com/blog

[email protected]

[email protected]

@ElizabethAyer

@dnlnln

Elizabeth Ayer & Dan Nolan

#SQLintheCityUK