Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6167371
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:30:01+00:00 2026-05-23T22:30:01+00:00

I always have a dilema: For a record, I can use column images (tinyint)

  • 0

I always have a dilema: For a record, I can use column images (tinyint) that is true if there is image for that record or false if there is not.

I can also not put that information in the database and in my code I “snoop” with disk filesystem check if the image exists.

Both give the same results of course. Having in database means maintaining the image state separately from the real image on disk, means harder to program and more prone to errors (disk image is not there any more, in the database the record has true on column image).

So I use disk check usually. But it occured to me, maybe this has a hard penalty on the disk access. I know database check must be faster, I have to get the record off the database anyway. But is looking for image using filesystem as bad as it occured to me or not?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T22:30:01+00:00Added an answer on May 23, 2026 at 10:30 pm

    Pros for storing it in the database:

    • You can create queries that answer questions like “Give me all objects that have no image”
    • Its much faster as you do not have to touch the disk

    I can see no pros for only storing it on disk. Use a pattern with a “single place of responsibility”, meaning that only one place in your code saves, updates, deletes images. In this place you update the file and the database. Done this way, its not very prone for errors.

    Put the other way round: if this makes your application prone for errors, you should check your architecture.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I always have this notion that writing SQL queries in the code behind is
I have a winforms datagridview that seems to always have at least one row
as the comments always have it, you can select to show the top 5
I always have a question about override custom event. I am not sure why
I found out that object constants in PHP always have public visibility so it
I always have loads on windows open and i can very see the SQL
Do we always have to use jdbc with Java programs for making connectivity with
I have a std::vector that I know will never have to grow--it will always
I have a uitree structure and use MultipleSelectionNodes property actived. I always have two
I have a field, justsomenum, of type decimal(3,2) in MySQL that seems to always

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.