undecaf / hibernate-file-storage

Storing files as BLOBs with Spring, JPA and Hibernate ORM

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Storing files as BLOBs with Spring, JPA and Hibernate ORM

Application servers may store uploaded files in the server's file system and persist only the file paths in a database. Obtaining a consistent backup of such a dataset may be difficult.

This sample project uses Spring, JPA and Hibernate ORM to store uploaded files as BLOBs in a database. MySQL supports 4GB BLOBs, H2 at least 16GB BLOBs and PostgreSQL even 4TB BLOBs. BLOBs are never materialized in memory.

Using BLOBs for file storage can be advantageous since this keeps the complete dataset in a single place (the database); this provides for consistent backups and synchronization in a database cluster.

Within this project, a few additional techniques are mentioned that might be useful.

Subjects

About

Storing files as BLOBs with Spring, JPA and Hibernate ORM

License:MIT License


Languages

Language:Java 100.0%