For questions about structuring the data within a database. How to lay out tables, whether to use a relational DB or not, etc.

learn more… | top users | synonyms

2
votes
2answers
48 views

SQL - Design concepts - Relationships - Referential Integrity - Cascading

THE SCENARIO I learned about basic database design concepts such as basic CRUD operations, referential integrity, relationships, etc., years ago. I've messed around with databases and used this ...
1
vote
2answers
58 views

Database error prevention

Im designing a database structure and I would like that it's design could prevent erroneous connections. I'll make a simple example, that I think it will be easy to understand, bellow are the tables: ...
2
votes
1answer
153 views

How to handle db authentication in multi tenant application with separate databases?

In a multi tenant application with separated databases for each tenant, what would be the best way to authenticate connection to each of these separate databases. My goal is to: Main security ...
0
votes
1answer
40 views

Recursive partitioning example

I am trying to understand an example in Chapter 12 (Query Processing) of Database System Concepts, Sixth Edition. A relation does not need recursive partitioning if M > nh +1, or equivalently M >...
2
votes
1answer
126 views

Should I store cryptographic hashes as a blob or as a string?

I'm new to MongoDB and am wondering how to decide to store some cryptographic hashes. Should I store the binary data itself, as a blob, or should I store its string representation as a string? My ...
2
votes
1answer
46 views

How to store 1:n self reference (dependencies) in relational database

What is a clean way to store items that reference multiple other items of the same type in a relational database? Say I have a list of jar files and their dependencies: package1 depends on package2,...
6
votes
3answers
115 views

Storing hours a merchant is open in postgres

In postgres, I need to store the hours a merchant is open each week. Essentially, the information you'd see posted on a sign in the merchant's door: Mondays: Closed Tuesday-Friday: 9am-1pm, 2pm-6pm ...
0
votes
0answers
33 views

Unifying database interface for multiple authentication methods

I'm working on a project with Mongo as the db. Currently, we only allow users to sign up with email and we look them up in the db by email address. But now we're moving to allow users to sign up ...
2
votes
0answers
167 views

How should I store usernames and passwords for user login using php/cassandra?

I am new to NOSQL and Cassandra. I am not sure if I should store usernames and password in Cassandra. If I should, what is the best way to do that? I am getting lots of conflicting ideas from research....
1
vote
2answers
57 views

DB Design for non static front-end

I have a question about best practices to design a database which have to hold the following data: There is a page with a questionnaire which has default questions like Firstname, Lastname, Street... ...
0
votes
0answers
30 views

Best way to create “attributes” for Neo4j node?

I have this node labeled "Person" and these various items from what would be a class, in a conventional DB. For example: Teacher, Lumber, Magician, Artist and Painter. They should all fit in the same ...
1
vote
1answer
44 views

User account model with two or three possible profile

My application will have at least two types of users: clients and companies, these are the types of profiles. Because each type of profile requires different additional information, it will be ...
1
vote
2answers
68 views

Difficult design with multiple associations between two entities

I'm trying to design the data schema and the restful api for a specific case. In my system I have several users and several books. Every book can have several users as authors and at the same time ...
2
votes
3answers
154 views

How can I store incomplete records but enforce data correctness?

I'm in the planning/design stages of a new project, and I'm having trouble coming up with a good way to handle one of the requirements: Users must be able to create a new record and save it as "...
2
votes
2answers
118 views

Database Design - lots of small tables or fewer, bigger tables?

So I'm designing a database for a project which is going to enable beauty businesses to create a profile, clients to create a profile and for the client's to be able to book appointments and for the ...
5
votes
2answers
85 views

Junction table related to another junction table

I'm defining a DB structure, and I have a strong feeling I'm not doing it right. I have hotels that can be configured to offer some optional services (airport pickup, massage), that can in turn be ...
-1
votes
1answer
63 views

Is there a generally accepted definition of “Secondary Index” independent of DB product? [closed]

Is the definition for "Secondary Index" anything more specific than just "Any index that is not the primary index"? EDIT: Here is some research I have done: Search Google. I evaluated the first 20 ...
42
votes
8answers
6k views

Is the use of NoSQL Databases impractical for large datasets where you need to search by content?

I've been learning about NoSQL Databases for a week now. I really understand the advantages of NoSQL Databases and the many use cases they are great for. But often people write their articles as if ...
9
votes
8answers
828 views

Designs and practices to guard against erroneous null entries from database

One part of my program fetches data from many tables and columns in my database for processing. Some of the columns might be null, but in the current processing context that is an error. This should "...
-2
votes
1answer
89 views

Should I be using XML to store configuration values in a database?

There are a couple of answers on SE comparing single-row table vs. name-value-pair table used for config settings, but I haven't seen anyone arguing for using XML (or JSON) as a name-value pair ...
1
vote
1answer
67 views

BigData: time-based word count

What we are trying to do: We're trying to build a system that will count the number of unique entries for a certain timeframe. It's working ok until the data grows up or the timeframe increase, then ...
3
votes
3answers
116 views

Relational table design for data ownership

Setup (schema simplified for clarity) Suppose I have a table called resource: +---------------+--------------+------+-----+ | Field | Type | Null | Key | +---------------+-----------...
2
votes
1answer
54 views

Design activities / events logging (ex: fields update) in RDBMS

I am trying to implement a activity tracking system in Ruby on Rails for an API only application. I have a table named letter with information as follow : id (primary key) sender_id (foreign_key on ...
5
votes
2answers
180 views

How to store ordered information in a Relational Database

I am trying to understand how to properly store ordered information in a relational database. An example: Say I have a Playlist, consisting of Songs. Inside my Relational Database, I have a table of ...
4
votes
2answers
158 views

What is the recommended strategy to deal with a frequently changing database model during development

A lot of projects have a to be determined database model during early development. This could mean that a lot of SQL will have to be rewritten frequently. What is the recommended strategy to deal with ...
5
votes
3answers
177 views

Is it a good practice to have a pre-filled embedded database for development?

I'm currently working on a project which only uses its database for data storage. This means there are no triggers or stored procedure in it, just tables and data to put into it. In this scenario I'm ...
1
vote
1answer
82 views

How to handle multiple “valid after {date}” in a performant way

We work on an Application which displays a duty roster and also some other DateTime related things. So my Database is full of Relations like in this small Example: This results in big ...
1
vote
1answer
205 views

Best Multiple tables product with categories

I was looking to create an EAV structure for an inventory management system. But I read this answer and decided against it. I am looking to create multiple tables for all my products. But the trouble ...
4
votes
2answers
51 views

AutoIncrement Integer Column,Guid or PGuid, which to choose?

Guid has been a Global Unique Identification. Why does "PGuid" (Global Unique Identification) appear? 1) Is Guid NOT PERMENT for unique? (I sometimes wonder whether Guid is REALLY PERMENT generator ...
3
votes
2answers
187 views

One wide table or multiple themed tables?

I'm trying to design a database for a simple text based game where the player characters have a large number of statistics that I want to track. Currently I have a few groups of related statistics, ...
2
votes
1answer
180 views

Elasticsearch and relational database combination

Imagine I have a marketplace application - where users can search for products (we concentrate on clothes). Every product has an ID, name (text), description (text), price (numeric), size (numeric), ...
0
votes
0answers
49 views

Designing how to add multiple items for a user in a database?

I'm relatively new into designing databases so this is my first project and I'm trying to understand better it's structure. I need to create a SQLite database where there will be a simple USERS table ...
10
votes
3answers
408 views

Which data store is best for my scenario?

I'm working on an application that involves very high execution of update / select queries in the database. I have a base table (A) which will have about 500 records for an entity for a day. And for ...
0
votes
4answers
137 views

How to avoid null in primary key? [closed]

I need to make table that seems to require two column primary key with one of the columns nullable. But according to questions I read on Stack Overflow that is undesirable and even against SQL ...
31
votes
5answers
4k views

No central database

I have a client that is looking to get a website/mobile apps/desktop apps built that deal with very sensitive data (more sensitive than bank/card details). Because of the sensitive nature of the data, ...
2
votes
2answers
269 views

Merging two applications into one

Background: My bosses want to merge two application that have two separate purposes. One being for monitoring of equipment and bandwidth for our internal network operations. The other is an ...
0
votes
2answers
78 views

Event places - venue and hotel (database design conceptual question) [closed]

Hope this question is right here. TL;DR Database design for event places (venue and hotel), hotels can be venues. Long Version Introduction I'm developing a software for trainings. Trainings are ...
4
votes
3answers
163 views

How to store records with variable structure?

We have an old system to manage inventory adjustments that is going to be remade. There are different type of reasons to make an adjustment, and each type requires different data to be filled. Some ...
3
votes
1answer
75 views

How far should I abstract my pseudo-database?

I'm building a [Process-Tracker] thing In Excel. I would use Access but I can't guarantee that the End-Users will all have it. So there will be a list of open cases, with a history of the previous ...
3
votes
1answer
71 views

Two tables with similar structure and referential integrity or one table

Overview My question revolves around balancing database and code simplicity using 2 options to design around the following requirement. Background Facts The DB: Sql Server The Code: ASP.NET MVC C#...
0
votes
1answer
69 views

SQL Table With A Call To Action?

This is all done in Microsoft Access 2007 and SQL Server. We are creating a way for our users to quickly make notes on a customer. These quick-notes will contain tags that will prompt the user for ...
13
votes
2answers
937 views

Is it wasteful to create a new database table instead of using enum data type?

Suppose I have 4 types of services I offer (they are unlikely to change often): Testing Design Programming Other Suppose I have 60-80 of actual services that each fall into one of the above ...
1
vote
0answers
82 views

Data Store Design for NxN Data Aggregation

I am trying to come up with a theoretical solution to an NxN problem for data aggregation and storage. As an example I have a huge amount of data that comes in via a stream. The stream sends the data ...
1
vote
1answer
353 views

Multi-tenant database design

My boss is currently working on a database design for a multi-tenant capable ERP/CRM system, which will have a Sql Server backend. Some key points of the design: A server instance will host a "...
2
votes
0answers
157 views

PHP Vertical Columns from 3 SQL Tables

I work at a high needs school in which there are several classes that plan their work through Excel spread sheets grading and tracking student progress. We have come to the conclusion that this ...
2
votes
1answer
95 views

Database Structure: A product that will only temporarily be available and then slightly change

I'm trying to migrate lagacy data to a new eCommerce system which I'm building myself and I have full control over (so I can modify it however I want). There is a product that came with a free gift ...
0
votes
1answer
226 views

How to design a database schema for a multi-user To-Do application in Azure?

I want to create a windows 10 universal to-do app with offline sync capability. So I checked out this tutorial which helped me to get started on the offline functionality. But I was wondering how ...
3
votes
1answer
125 views

Storing an all day event in database

I have an event table that should store events (dt_start, dt_end, all_day,etc). I saw that .ical files stores dt_start and dt_end as the same day (without time) for an "all_day" event. Question: ...
1
vote
1answer
72 views

multiple accounts with the same roles represented as one row in the database

Say there is an online hotel management application. One feature is the Receptionist will confirm and cancel bookings made by the customer. So all Receptionists do the same things. Is it bad practice ...
4
votes
2answers
96 views

Storing persistent data that only has a single instance but can change

I'm creating a website CMS in Rails (for fun and learning) and I'm trying to figure out how I'm going to store the data for an "about" page. Due to the nature of this page, the data will only have one ...