Sample Header Ad - 728x90

Should a frequently-growing log file be stored as a table or a blob in the database?

1 vote
2 answers
296 views
I'm an undergrad and haven't worked with any actually database yet so my apologies if I misunderstand/misuse any terms. My question comes from an assignment of mine, but this is my attempt at learning and not having my homework done for me. The assignment, paraphrased: A university's printing service allows students on the campus to upload their files to the system and send uploaded files to one of the university's printers for printing... The system logs all printings done by all students, recording the student's ID, which printer was used, the print file's name as well as the time of printing. An admin of the system should be able to view the log file filtered to any students, printers and/or time period (to my knowledge this requires indexing). A question I come across is which data storage approach (database or file system) I should be using for the student's files and the log file, with both being frequently-growing data. From this SO question I gathered that frequenting updating files are better stored as file system storage, and from this question that files could be stored in a database with blobs. My questions are: 1. Should the log file be stored with database or file system? (Or I reckon the determining question would be "Is it possible to filter by multiple values without indexing?") 2. If student files are stored with a blob related to a student in the database table, is it possible for each student to only have access to their own files? 3. Why is the file system better fitted for frequently-growing files? 4. Is it possible (or practical) for a server to use both database and file system?
Asked by Cydennn (13 rep)
Nov 5, 2023, 12:27 PM
Last activity: Nov 6, 2023, 12:30 PM