DEV Community


Discussion on: Where do you store your apps flat file databases?

dmerand profile image
Donald Merand

Capistrano deployments with Rails have some good defaults - the app is always deployed into a timestamped folder that's sym-linked to a "current" folder. Shared resources like databases, file storage, are put into a top-level folder that's not (typically) overwritten on commit. So...

# Commit files to here...

# Symlink these files, which are what gets served.
/project/current -> /project/versions/20180318
/project/current/database.json -> /project/shared/database.json

That approach works decently well to keep things separated without being too confusing.