DocumentDB
Published 14 February 2025
- Status: Preview
- Flyway configuration: Native Connectors only
- Verified Versions:
docdb 5.0.0
- Maintainer: Redgate
Supported Versions and Support Levels
- For information regarding the supported version and support levels available, please see Supported Databases for Flyway
- For information regarding the Flyway features available, please see Flyway feature summary
Driver
Item | Details |
---|---|
URL format | mongodb://ip address:port number/database_name |
SSL support | Yes |
Ships with Flyway Command-line | JSON migrations: Yes. Javascript migrations requires Mongosh to be installed separately |
Maven Central coordinates | n/a |
Using Flyway with MongoDB Native Connectors
- Whilst this is in preview, you will need to set the environment variable
FLYWAY_NATIVE_CONNECTORS=true
on Redgate editions of Flyway. - If you are using javascript migrations then you'll need
mongosh
to be installed. - There is a tutorial available here.
Observations
AWS DocumentDB aims to be MongoDB compatible - as such we use the Flyway MongoDB infrastructure and can only verify that Flyway's verb testing works.
- We saw this error:
MongoServerError: Retryable writes are not supported
which was overcome by addingretrywrites=false
to the connection string, See Functional differences: Amazon DocumentDB and MongoDB - We had to set up an SSH tunnel to work on DocumentDB from outside of the AWS VPC
- TLS is enabled by default on DocumentDB and requires the Java Truststore to be set up to work with AWS.
Limitations
The Flyway Native Connectors blog post describes more of the details of the Native Connectors changes.
- Transactions are only available with JSON migrations (these use the API and not Mongosh)
- Dry run is not available
Terminology
We have to map Flyway concepts and language rooted in the relational database world to MongoDB - this is how Flyway sees the mapping:
MongoDB Concept | Flyway Concept |
---|---|
database | database/schema |
collection | table |
row | document |
transaction | transaction |