Reputation: 2086
I'm searching an embedded native Java database (I cannot use an out of process database) which can handle large blob objects (up to several GB). I have tried the H2, but this is very slow when deleting large blobs. Off course this is because it has to maintain/rebuild the single database file.
Are there any databases that will give me fast insert and delete with blobs?
Update: I ended up not using a database. Instead i created a byte-store appending bytes to a open filestream and storing the filename, offset, length in a database. Large blobs was not appended but stored as independent files. This was the only way to get good performance. Delete operations would only work on the large blobs, didn't need it for the small blobs, size was insignificant (my threshold is 100 KB)
Upvotes: 1
Views: 1207
Reputation: 116848
Are there any databases that will give me fast insert and delete with blobs?
If H2 didn't work then you can try Derby or SQLite but there is no guarantee that they will perform any better. I think you should consider re-architecting your project. Storing large blob objects in this way is very inefficient.
I would consider using some other mechanism to persist the files and the storing a path or id of the file in the database. You mentioned that you have reasons to not use the filesystem. If you edit your question to explain your reasons to use a database entirely then I/we can respond to better suggest alternatives.
Upvotes: 0
Reputation: 108939
Does it need to be a pure Java database, or is a database/JDBC driver using a native library also allowed? If so, you could look at Firebird Embedded and Jaybird.
Disclaimer: I am one of the developers of Jaybird
Upvotes: 0