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

  • Home
  • SEARCH
  • 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 1045725
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T16:01:51+00:00 2026-05-16T16:01:51+00:00

I’m working on a database schema that’s driving me a little mad at the

  • 0

I’m working on a database schema that’s driving me a little mad at the moment because I seem to be repeating the same tables to reproduce behaviour for different types.

Basically the system consists of live sensors that are monitored over a network, and loggers that are collected via a handset. The sensors and loggers are divided up into Locations, and Locations are divided up into Areas. A location can have up to 1 logger, but can have any number of live sensors.

I’ll try and break the rules down:

  1. The system can have 0 to many Areas
  2. An area can have 0 to many Locations
  3. A Location can have 0 to 1 Loggers
  4. A Location can have 0 to many LiveAnalogSensors
  5. A Location can have 0 to many LiveSwitchSensors
  6. A Location can have 0 to many Actions allowed
  7. A LiveAnalogSensor must belong to 1 LiveSensorRelay
  8. A LiveSwitchSensor must belong to 1 LiveSensorRelay
  9. A logger can have 0 to many Readings
  10. A LiveAnalogSensor can have 0 to many Readings
  11. A LiveSwitchSensor can have 0 to many Readings
  12. A Reading can have an Alarm
  13. The system can have 0 to many Actions
  14. An Alarm can have 0 to 1 Action applied to it
  15. An Alarm can have 0 to 1 AlarmResolution

The schema picture is HERE.

So the scenario is, a reading comes in and is stored (either via the Logger download or a live reading coming in over the network). The reading is out of range so it has an alarm code. An alarm gets generated for that reading. An action is eventually applied to it by the user. If a reading comes in that indicates the alarm condition has ended, an AlarmResolution (or AlarmEnd as I called it in the schema) entry is made linked to the Alarm to show that it has ended, and the time it has ended.

On analog alarms, whenever a new reading is higher than the last, a new “Peak” reading is stored, which is what the AnalogSensorReadingAlertPeak table is for.

That is basically it. My issue is how repetitive the schema seems for the different sensors (especially logger and analog-sensor which are basically the same) – and I seem to have a lot of 1 to 0..1 relationships, though I’m less concerned about that.

I’m after a sanity check really. I can think of ways to get rid of the repetitiveness, but it always seems to be at the expense of data integrity.

Thanks.

EDIT: I’ve revised the title and question slightly after the down vote as it wasn’t particularly specific. I hope it’s better now..

  • 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-16T16:01:51+00:00Added an answer on May 16, 2026 at 4:01 pm

    I’d say it’s repetitive if each Sensor (for example) has exactly the same properties (columns).
    If they differ at all, they should have different tables.

    I’d try capturing this using NORMA or similar too to validate the design.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want use html5's new tag to play a wav file (currently only supported
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti

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.