Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Db Snapshots Laravel Package

spatie/laravel-db-snapshots

Artisan commands to quickly create, load, list, and clean up database snapshots in Laravel. Dump your DB, restore any snapshot (or the latest), and keep only recent dumps. Supports MySQL, PostgreSQL, and SQLite.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Database-driven feature development: Accelerate iteration by capturing and restoring database states for rapid testing of new features (e.g., A/B tests, experimental workflows).
  • Regression prevention: Enable teams to snapshot pre-release states and revert to them if post-deployment issues arise, reducing rollback complexity.
  • Multi-environment parity: Standardize development/staging/production database states for consistent debugging or data migration testing.
  • Build vs. buy: Avoid reinventing database backup/restore logic; leverage a battle-tested, Laravel-native solution with minimal maintenance overhead.
  • CI/CD integration: Automate snapshot creation/loading in pipelines (e.g., post-deployment validation, pre-migration checks) to enforce data integrity gates.
  • Compliance/audit trails: Retain immutable snapshots of critical data states for audits or disaster recovery (e.g., GDPR data exports, financial reporting).
  • Onboarding/education: Provide fresh, reproducible database states for new team members to avoid "works on my machine" issues.

When to Consider This Package

  • Avoid if:
    • Your database exceeds 10GB+ (streaming support mitigates this but may still be slow; consider dedicated backup tools like mysqldump/pg_dump for large-scale needs).
    • You require incremental backups or point-in-time recovery (this package is full-dump only).
    • Your team lacks Laravel familiarity (package assumes Artisan command proficiency).
    • You need cross-platform snapshots (e.g., MySQL → PostgreSQL; this is connection-specific).
    • Security/compliance mandates encrypted backups at rest (package stores snapshots as plain SQL files by default; encryption must be added via filesystem drivers).
  • Look elsewhere if:
    • You’re using non-Laravel PHP frameworks (this is Laravel-specific).
    • You need real-time replication or active-active sync (this is for static snapshots).
    • Your database includes binary data (e.g., BLOBs >1MB; may require custom handling).
    • You require scheduling/automation beyond CLI (e.g., cron jobs; consider wrapping commands in a task scheduler).

How to Pitch It (Stakeholders)

For Executives/Stakeholders:

*"This package lets our engineering team save and restore database states in seconds—like a ‘Ctrl+Z’ for our production data. For example:

  • Reduce deployment risk: If a new feature breaks staging, we can revert to a known-good snapshot in minutes instead of debugging for hours.
  • Accelerate innovation: Teams can experiment with database changes (e.g., schema tweaks, data migrations) without fear of breaking shared environments.
  • Cut costs: Eliminates the need for manual mysqldump scripts or third-party tools for basic snapshot needs.
  • Scalable: Works for small projects and can handle moderate-sized databases (up to ~10GB with streaming). Investment: Minimal (open-source, MIT-licensed) with payback in faster iterations and fewer production incidents."*

For Engineers:

*"Problem: Managing database states across dev/staging/prod is a pain—manual dumps, inconsistent environments, and no easy way to revert changes. Solution: This package gives us Artisan commands to:

  • Snapshot: php artisan snapshot:create (supports partial tables, compression, and multi-connection).
  • Restore: php artisan snapshot:load (with streaming for large DBs, optional table drops).
  • Manage: List, delete, or auto-cleanup old snapshots. Why it’s better than alternatives:
  • Laravel-native: No hacky shell scripts or external dependencies.
  • Flexible: Exclude tables, target specific connections, or compress snapshots.
  • Extensible: Hook into events (e.g., trigger notifications when snapshots are created).
  • Well-supported: Actively maintained (Laravel 10–13, PHP 8.2+), with 1.2K+ stars. Trade-offs:
  • Not for massive databases (but streaming helps).
  • No encryption by default (use s3 disk with encryption for sensitive data). Ask: Let’s pilot this for our next feature release—it’ll save us hours in debugging and rollbacks."*
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport