alembic
Alembic is a database migration tool for Python applications using SQLAlchemy. It automates schema changes, supports version control-like workflows for migrations, and works across multiple databases including SQLite, PostgreSQL, and SQL Server.
Key facts
Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.
| Field | Value |
|---|---|
| Repository | sqlalchemy/alembic |
| Owner | sqlalchemy |
| Primary language | Python |
| License | MIT — OSI-approved |
| Stars | 4.2k |
| Forks | 348 |
| Open issues | 121 |
| Latest release | rel_1_18_5 (2026-06-25) |
| Last updated | 2026-06-30 |
| Source | https://github.com/sqlalchemy/alembic |
What alembic is
Alembic provides declarative and imperative migration scripts, auto-generation of schema diffs, transactional DDL support, non-linear dependency graphs for complex branching scenarios, and DDL constructs compatible with SQLAlchemy ORM. It generates Python or raw SQL migration files and includes batch mode for SQLite ALTER limitations.
Get the alembic source
Clone the repository and explore it locally.
git clone https://github.com/sqlalchemy/alembic.gitcd alembic# follow the project's README for install & configurationNeed it deployed, integrated, or customized instead? DEV.co ships production installs.
Best use cases
Implementation considerations
- Alembic requires SQLAlchemy ORM or Core integration; ensure your data models are defined in SQLAlchemy before initializing migrations.
- Auto-generation detects schema changes but does not replace developer review; many real-world migrations require custom data transformations and logic.
- For transactional DDL, verify database support (PostgreSQL, SQL Server); MySQL and SQLite have limitations that affect rollback behavior.
- Batch mode must be explicitly enabled for SQLite; teams supporting SQLite should test batch migration workflows early.
- Non-linear versioning (branching, merges) provides flexibility but can introduce operational complexity if not governed by clear team conventions.
When to avoid it — and what to weigh
- Non-SQLAlchemy Projects — Alembic is tightly coupled to SQLAlchemy. Use alternative tools if your data layer does not use SQLAlchemy ORM or Core.
- Real-Time Schema Inference Required — Alembic assumes explicit migration files. Projects needing zero-downtime rolling migrations without explicit versioning may require additional tooling or orchestration.
- Schema Complexity Beyond DDL — Data-heavy migrations or cross-schema dependencies require custom Python logic. For systems with extensive procedural logic, manual scripting overhead increases.
- No Database Access During Deployment — Script-only output mode helps but does not eliminate the need for eventual database connectivity. Environments requiring fully offline schema deployment may face operational friction.
License & commercial use
Alembic is distributed under the MIT License, a permissive OSI-approved license. MIT permits commercial use, modification, and distribution with minimal restrictions (retain copyright and license notice).
MIT license permits commercial use without royalties. No known commercial restrictions or dual-licensing. Review the LICENSE file in the repository for exact terms and ensure your legal team approves use in your commercial product.
DEV.co evaluation signals
Editorial assessment — not user reviews. Directional, with an explicit confidence level.
| Signal | Assessment |
|---|---|
| Maintenance | Active |
| Documentation | Strong |
| License clarity | Clear |
| Deployment complexity | Low |
| DEV.co fit | Good |
| Assessment confidence | High |
Alembic scripts execute arbitrary Python and SQL; treat migration files as code subject to review and version control. Ensure database credentials are not hardcoded in alembic.ini or scripts; use environment variables or secrets management. Audit trail depends on your database and application logging. No known CVEs in available data, but review dependencies (SQLAlchemy) for known vulnerabilities.
Alternatives to consider
Flyway
Language-agnostic, Java-based, strong support for multiple databases and zero-downtime deployments. Better suited for teams not using SQLAlchemy or requiring a standalone tool.
Liquibase
XML/YAML-driven migrations, broad database support, strong in enterprise environments. Higher overhead but greater tool-driven validation. Lacks tight ORM integration.
Django Migrations
Built into Django ORM; simpler for Django projects. Alembic is superior for standalone SQLAlchemy apps or non-Django frameworks.
Build on alembic with DEV.co software developers
Our engineers can design migration strategies, optimize CI/CD workflows, and ensure schema safety across your environments. Let's talk.
Talk to DEV.coRelated open-source tools
Surfaced by semantic similarity across the DEV.co open-source index.
Related on DEV.co
Explore the category and the services that help you build with it.
alembic FAQ
Can I use Alembic without SQLAlchemy ORM?
Does Alembic auto-generate all my migrations?
Can I rollback a migration if something goes wrong?
How do I handle multiple database targets in a single codebase?
Software developers & web developers for hire
DEV.co helps companies turn open-source tools like alembic into production software. Our software development services cover the full lifecycle — architecture, web development, integration, and maintenance — delivered by software developers and web developers who ship. Engage our software development agency to implement or customize it for your open-source databases stack.
Need Help Integrating Alembic into Your Stack?
Our engineers can design migration strategies, optimize CI/CD workflows, and ensure schema safety across your environments. Let's talk.