Skip to content

Instantly share code, notes, and snippets.

@pydanny
Last active December 30, 2015 02:09
Show Gist options
  • Save pydanny/7761182 to your computer and use it in GitHub Desktop.
Save pydanny/7761182 to your computer and use it in GitHub Desktop.
Storing files in a database field should never happen. If it's being considered as a solution
to a problem, find a certified database expert and ask for a second opinion.
\bigskip
To summarize PostgreSQL expert Frank Wiles on the problems with using a database as a filestore:
\begin{itemize}
\item `read/write to a DB is always slower than a filesystem'
\item `your DB backups grow to be huge and more time consuming'
\item `access to the files now requires going through your app (Django) and DB layers'
\end{itemize}
See \link{http://www.revsys.com/blog/2012/may/01/three-things-you-should-never-put-your-database/}
\bigskip
When someone thinks there is a good use case for serving files from a database, and quotes a success
like \link{https://npmjs.org} (stored files in CouchDB), it's time to do your research. The truth is
\link{https://npmjs.org}, is as of this writing, trying to migrate it's database-as-filestore system
to a more traditional fileserving method (see \link{https://scalenpm.org/}).
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment