DEV Community

loading...

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

Collapse
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...
/project/versions/20180318/yer-source
/project/shared/database.json

# 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.