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 8119077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T04:41:41+00:00 2026-06-06T04:41:41+00:00

In a mysql MyISAM table, I have a column type mediumblob and storing captured

  • 0

In a mysql MyISAM table, I have a column type mediumblob and storing captured image as blob data. I got some interesting and problematic images. Some of the images are gradually losing data.

Field          type  
--------------------------
image         mediumblob

my.ini max allowed packet size set max_allowed_packet = 8M

image1
image2
image3

this is the problem

When the C# application fetches the data from the server, this kind of images losing data of random sizes every time. I got 10-12 bad images like this in 100000+ image data.

What could be the reason of this kind of behavior? Anyone has any idea/solution how to fix/avoid this problem.

Update 1:
Reading bytes form PictureBox

MemoryStream ms = new MemoryStream();
byte[] ret = null;

try
{
     picturebox.Image.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
     byte[] Data = new byte[ms.Length];
     ms.Read(Data, 0, (int)ms.Length);
     ret = byteData;
     ms.Close();
 }         
 

Saving the bytes array into database as medium blob data. When retrieving the data from database I am casting the reader data:

byte[] Data = (byte[])reader["Image"];
  • 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-06-06T04:41:42+00:00Added an answer on June 6, 2026 at 4:41 am

    Culprit is MyISAM storage type.

    We used InnoDB storage to store one million images and conducted stress test, we had proper results. Either file was retrieved correctly or it was not at all retrieved (less than 0.01%), since InnoDB is acid compliant.

    When we shifted to MyISAM, failure rate increased to 20% with lossy data as well same as your case. And reason was, MyISAM uses table lock, so while write is in progress entire table is locked and in event of timeout, it does overwrite something leading to data loss.

    We have now shifted everything to MS SQL, since InnoDB performs well but still it never reuses deleted file space, so InnoDB endlessly keeps on growing. MS SQL express has limit of 10gb, so we created pages of 4-8gb and we store blobs there. And we have our own custom replication to replicate files over three servers across network with same config.

    Storing as files on disk is bad for many reasons, everyone keeps on saying file systems are designed for high performance and can store million files, this is not true, drives fails to perform faster when you have more than 100 thousand files. They perform well with one big file then 1000 smaller files. Currently we are storing 10 million files and storing it in db makes more sense because db does optimization over query and does good caching. You can read more at http://akashkava.com/blog/127/huge-file-storage-in-database-instead-of-file-system/

    This is the exact reason why MongoDb, Hadoop, Azure Blob Store, Haystack and Amazon S3 were invented.

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

Sidebar

Related Questions

I have a MySQL MyISAM table with about 400 million rows of price data
I have a MySQL 1.5 GB MyISAM-table (1.0 GB data, 0.5 GB indexes) in
I'm storing unique user-agents in a MySQL MyISAM table so when I have to
Say you have a MySQL 5.0 MyISAM table with 100 million rows, with one
I have a large mysql MyISAM table with 1.5mil rows and 4.5GB big, still
We have a large MyISAM table that is used to archive old data. This
I have a mysql MyISAM table with many rows that contain information about places,
I have a MySQL-table called customers1 running engine MyISAM. I've created a full text
I have a MySql MyISAM table with a full text index, like this: CREATE
I have a MySql table (MyISAM) with 25.000 records and 1.8 MB size. The

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.