How do you keep references to files in the OBD PostgreSQL?



  • It was originally planned to keep the files directly to the OBD system, but it wasn't the best idea. Read that only files should be stored in the OBD system. There are several questions from here: (1) What kind of field would you like to use? (2) How do you connect the files to the bd and keep the link and pull the file accordingly?



  • It's usually not a reference to a file, it's just his idysh, if you need to keep a name in mysql - varchar(255) - analog to postggress.

    Because you don't need to keep the whole way to the file, you can limit the field of the length of the file. And if you just keep a file, well... you're just doing a numerical field of sufficient length to store millions or billions of files.

    Your code sets the way to the catalogue and the iodine/name file in the right place.

    Either if you need to keep the files in secret so that the user doesn't move the files or guess the names, keep the xash, or make the unique aides for each session, pass the hosh scrupt that reads the file and gives it to the browser, and the reference from one user will not work for another.

    @cridnirk rights, store or not store files in bd, depending on the project. It's usually not worth it. For compact small sites, especially if you don't want to deal with the storage of files, the way, and just roll the bud down there, maybe. For example, you don't have the time and the strength to build normal tags, etc., but there's a few bd servers that have rejoined - and you have a ready tag of files.

    Not relevant, but I'll add to the comment: Removals of the rejoining line can be repaired: the delay of one line for 15 minutes / and the other for 24 hours gives you some room for manoeuvres in the event of catastrophic delete/drop, etc.

    The presence of the fields of status, created, updated generally prevents the use of these replications, as only manual/automatically after year or more is removed in the correct architecture. Instead of being deleted, the field is updated, so you can easily find changed records. Scripts are not entitled to delete.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2