IEEE-RVCE / IEEE-RVCE.github.io

Development site of only frontend
https://ieee-rvce.org
1 stars 2 forks source link

Storing Data on File is Not Ideal #84

Closed Prajwalprakash3722 closed 1 year ago

Prajwalprakash3722 commented 1 year ago

Storing data on a file is not ideal, especially for long-term data storage, as it can grow over the time and It's our responsibility to make sure that the file doesn't become unmaintainable. It is difficult to query and search data stored in a file. Scaling the system becomes a challenge when using a file-based approach.

Proposed Change: Have objects coming from the backend, we could create a table (mysql for sample) and add simple CRUD operations

CREATE TABLE executive_committee (
  id INT PRIMARY KEY AUTO_INCREMENT,
  group_name VARCHAR(50) NOT NULL,
  name VARCHAR(50) NOT NULL,
  position VARCHAR(50) NOT NULL,
  image_path VARCHAR(255) NOT NULL
);

we can figure out the rest of the details later but I think for longer sustainability and SANITY storing image and objects on DB makes sense instead of storing them on the file. It'll be also easy to update the images for the longer run, If possible we can try and resize the images using ImageMagic while processing. That would save lot of overhead over the webmaster.

I know its late to implement this for now, I'm just saying for the longer run :)

Cheers 😄

FYI @chrisvrose @MayurSChittaragi @sannidhi-s-shetty

Prajwalprakash3722 commented 1 year ago

Instead of imagepath we can just link it to gallery (image) table via FK :)

Take the image compress it and convert it to blob (binary object) and store it.