Em chào mọi người
Em đang tìm hiểu dữ liệu Blob sử dụng H2 DB của spring boot kiểu dữ liệu này có thể lưu tất cả các dạng file phải k ạ? Và trong spring có hỗ trợ convert File từ java để lưu xuống db với kiểu Blob k ạ? Em cảm ơn
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
1. Theo anh thấy là có thể lưu tất cả các dạng file em ạ.
2. Spring thì chưa hỗ trợ, em sẽ cần phải đọc file thành InputStream hoặc byte[] hoặc blob rồi lưu xuống db.
3. Tuy nhiên anh nghĩ là em nên lưu file ở trên server hoặc s3 hoặc 1 dịch vụ datastore nào đó thì sẽ tốt hơn là lưu vào db em ạ. Vì nếu lưu 1 file có dung lượng lớn hàng chục MB trở lên thì việc đọc ghi sẽ gặp nhiều khó khăn và chậm chạp, dễ bị tràn bộ nhớ. Thêm vào nữa khi dung lượng DB lớn lên thì việc backup cũng sẽ bị ảnh hưởng rất nhiều đó em ạ.