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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:39:35+00:00 2026-05-24T23:39:35+00:00

I am creating a new DB in MySQL for an application and wondered if

  • 0

I am creating a new DB in MySQL for an application and wondered if anyone could provide some advice on the following set up. I’ll try and simplify things as best as I can.

This DB is designed to store alerts which are related to specific items created by a user. In turn there is the need to store notes related to the items and/or alerts. At first I considered the following structure…

USERS table – to store basic app user info (e.g. user_id. name, email) – this is the only bit I’m fairly certain does not need to be changed

ITEMS table: contains info on particular item (4 fields or so). Contains user_id to indicate which user created/owns this item

ALERTS table: contains info on the alert, item_id to indicate which item the alert is related to, contains user_id to indicate which user created alert

NOTES table: contains note info, user_id of note owner, item_id if associated with an item, alert_id if associated with alert

Relationships:

An item does not always have an an alert associated with it
An item or alert does not always have a note associated with it

An alert is always associated with an item. More than one alert can be associated with the same item.

A note is always associated with an item or alert. More than one note can be associated with the same item or alert.

Once first created item info is unlikely to be updated by a user.

For arguments sake let’s say that each user will create an average of 10 items, each item will have an average of 2 alerts associated with it. There will be an average of 2 notes per item/alert.

Very common queries that will be run:

1) Return all items created by a particular user with any associated alerts and notes. Given a user_id this query would span 3 tables

2) Checking each day for alerts that need to be sent to a user’s email address. WHERE alert date==today, return user’s email address, item name and any associated notes. This would require a query spanning 4 tables which is why I’m wondering if I need to take a different approach…

Option 1) one table to cover items, alerts and notes. user_id owner for each row. Every time you add a note to an item or alert you are repeating the alert and/or item info. Seems a bit wasteful but item and alert info won’t be large.

Option 2) I don’t foresee the need to query notes (famous last words?) so how about serializing note data so multiple notes are stored in one row in either the item or alert table (or just a combined alert/item table)

Option 3) Anything else you can think of? I’m asking this question as each option I’ve considered doesn’t feel quite right.

I appreciate this is currently a small project and so performance shouldn’t be of great concern and I should just go with the 4 tables. It’s more that my common queries will end up being relatively complex that makes me think I need to re-evaluate the structure.

  • 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-24T23:39:35+00:00Added an answer on May 24, 2026 at 11:39 pm

    I would say that the common wisdom is to normalize to start and denormalize only when performance data suggest that it’s necessary.

    Make sure that your tables are indexed properly, with foreign key relationships for JOINs.

    If you think you’ll end up with a lot of data, this might be a good time to think about a partitioning strategy. Partitioning your fast-growing tables by time would be a good first step.

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

Sidebar

Related Questions

Hi I am getting the following erro while creating new Account in CRM 2011.
I'm creating my first ROR application. Details: creating new app -> rails new simple_cms
I'm creating a new web application (Rails 3 beta), of which pieces of it
I'm creating an application that I want to run on either MySQL or SQL
I am new in creating application in Visual Studio 2010. I recently created an
I am new in creating application using Visual Studio 2010 and Microsoft Access 2007.
I am currently creating a C# application that supports MySQL and MSSQL databases. The
I'm creating a multi-user/company web application in PHP & MySQL. I'm interested to know
I'm new to creating applications using Visual Studio 2010 and MySQL. I am creating
I am creating a PyQt application that stores its data in a MySQL database.

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.