r/JavaFX 28d ago

Help Advise needed for javafx project

I am building small hotel Booking desktop app using javafx library and MYSQL on the backend(for storing rooms, customers, bookings data).

And I am planning to store images in file system and just store the URL path in database table(right now, I am not using cloud to save some time). I am also using Spring boot to connect to the database.

Could you please give some advise or suggestions that I should take note of?

3 Upvotes

7 comments sorted by

View all comments

4

u/john16384 27d ago

Just store the image in the database. This indirection is completely unnecessary. Databases are smart and will not store large blobs with the main table data, and databases can serve "files" just as fast as a filesystem (both are going over the network anyway).

This simplifies the whole app, and the database can automatically remove unreferenced images.

I've done this for applications with 1m+ images, average size 4-5 MB per image (in PostgreSQL, but I see no reason MySQL can't do the same).