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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T08:12:04+00:00 2026-05-29T08:12:04+00:00

All, I am trying to create a table to receive user inputs (UGC). This

  • 0

All,

I am trying to create a table to receive user inputs (UGC). This content could vary in size from a single character up to a few hundred words. The input will be coded in utf8_unicode_ci and could be in Latin or multi-byte characters.

The input will have to be searchable.

(Longer term I might want to store non-text objects – pictures and the like, but for now let’s focus on UTF8 text.)

At this point, I am only envisioning 2 fields to this table: an ID (autoincrement INT(10) ) and the UGC itself. (I might need a few more fields like dateAdded, etc.)

How should I structure my DB to allow for a good compromise between flexibility and performance? I could…

  1. Set up a high limit on the size of the string and take the performance & usability hits.
  2. Create several tables for various size ranges (and eventually types), and identify each item by a combination of table name and ID (so I’d need a central table with unique ID, table name, table-specific ID).
  3. I could store each object separately and simply have the db store a url. I suspect that ends up being a less efficient version of #2, but I’m out of my depth.

Thank you,

JDelage

  • 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-29T08:12:05+00:00Added an answer on May 29, 2026 at 8:12 am

    There is a good rule of thumb – and as all rules of thumb it is far from perfect – that has been working quite well for me:

    • If the DB “understands” the content of a potentially BLOBy field, store it in the DB
    • If the DB has no understanding of the content, store it externally

    With this and my experience so far in mind, I discourage use of a BLOB field for images etc.

    Now when thinking of content, that can be text, image or whatever, I am quite sure your business logic will need some field, that tells it how to use the content of the big field anyway – it’s hard to think of an app that would treat an image as an image just after looking at the data. So I recommend you create such a field, mimetype would come to mind, and a, say, mediumtext field. Your app business logic could easily deduce, that mimetype='text/plain' would mean the data in the text field is the payload, while mimetype='image/png' would mean, that the data in the text field is the (relative) path to a file resource.

    This gives you searching and indexing on the content, with quite a low probability of false matches, if you create your file pathes in a way, that is not expected to be a word in any language. MD5(basename).suffix comes to mind.

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

Sidebar

Related Questions

I'm trying to create a page by using view 2. This page list all
I am trying create a table and add this table into tablecell (table inside
I'm trying to create a check/uncheck all CheckBox for a number of CheckBoxes that
I'm trying to create a splash screen that shows assemblies (all referenced library) loading
I'm trying to create a Regex to block all < and > in a
I'm trying to create a utility class for traversing all the files in a
I'm trying to create a css menu bar that has all grey text with
I'm trying to create a good way to handle all possible collisions between two
I'm trying to create a SharePoint web part that will display all the users
I'm trying to create an array in MIPS Assembly, and then add all 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.