Skip to content

Question: concurrency #464

Closed
Closed
@germanSancho

Description

@germanSancho

Hello,

First of all, thanks for this great library!

I have a concern about how concurrency is handled when executing migrations. What happens if several people (or several scripts) try to run a db-migrate up at the same time against the same database? Is there any locking mechanism?

This is my usecase: I want to add db-migrate up as part of my deployment workflow (inside my npm run script) so when I deploy a new version of my app in an environment, new migrations are executed automatically. In environments like heroku, kubernetes and the like, several instances can be started concurrently, so the migration scripts can be launched concurrently. Without a locking mechanism, this can result on the same migrations being executed several times, etc.

I know that in Liquibase, for example, uses a separate "lock" table to prevent this kind of problems (see http://www.liquibase.org/documentation/databasechangeloglock_table.html).

I seems to me that there is no equivalent mechanism in db-migrate currently. Am I mistaken? If not, are there any plans for implementing it in the future?

Thanks!


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions