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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:40:43+00:00 2026-06-18T01:40:43+00:00

I’m storing emails in a mysql-database and was wondering if it’s a good idea

  • 0

I’m storing emails in a mysql-database and was wondering if it’s a good idea to use compress (https://dev.mysql.com/doc/refman/5.5/en/encryption-functions.html#function_compress) to store the fetched email-attachments in the database to reduce the size of the database.

Why I’m hesitating is, that most attachments are already compressed (like jpg). The other reason is that I couldn’t find anything about the efficence of the build-in compression-algo of MySql.

  • 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-18T01:40:45+00:00Added an answer on June 18, 2026 at 1:40 am

    Given the additional information that you’ve given, it seems that (a) you don’t need to be able to search files, just retrieve them and (b) your DB is limited to 1GB. I would recommend that rather than storing the files in the DB at all, you simply store a ‘key’ to the file, which is probably just a unique filename.

    In your database you can store the original user filename but write the attachment(s) to a filestore with a unique identifier (it could even be just a column ID or you could create a proper GUID.

    This will keep your database small, and retrieving attachments from file will not take any longer than retrieving them from the DB. When you write the file back out on retrieval, pass the original filename rather than your renamed and unique one.

    If you are expecting a lot of files then you could shard storage across directories so that they don’t get too large and eventually you could span across file systems if you needed.

    If 1GB is the limit for both the DB and your storage then of course this probably doesn’t help a lot. In that case, yes you should compress the files, but as you’re already aware, you may not get a very good compression ratio on files that are already in a compressed format.

    One final point in favour of keeping the files outside of the database is that it could help to keep the DB lean, and therefore faster for backup/restore or migration activity.

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

Sidebar

Related Questions

Let's say I'm outputting a post title and in our database, it's Hello Y’all
I am confused How to use looping for Json response Array in another Array.
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want use html5's new tag to play a wav file (currently only supported
This could be a duplicate question, but I have no idea what search terms
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I've tracked down a weird MySQL problem to the two different ways I was
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm not entirely sure how I managed to jack this up. http://pretty-senshi.com If you

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.