项目作者: undecaf

项目描述 :
Storing files as BLOBs with Spring, JPA and Hibernate ORM
高级语言: Java
项目地址: git://github.com/undecaf/hibernate-file-storage.git
创建时间: 2020-06-22T09:22:29Z
项目社区:https://github.com/undecaf/hibernate-file-storage

开源协议:MIT License

下载


:warning: This repository is no longer being maintained and has been archived.

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