New answers tagged database-design
1
vote
Should I break a large user table into smaller tables for specific roles and information?
For "thousands", splitting (or not) will make little difference to performance. Even for millions, it may not matter.
For maintainability and performance, let's see the main queries.
JSON ...
0
votes
Database architecture with extension in mind
Relational database management systems expect well-defined data structures - the "relations" in the name. So having runtime-variable needs is a known hard problem.
That said, most recent ...
1
vote
Database architecture with extension in mind
You could use a non-relational database to store this kind of data. For example, in mongoDB you could have a games collection. Then in your application code, you might have multiple data models:
...
1
vote
Must fact tables be designed for aggregation?
The column list for every fact table I have ever made has been of the form "primary key followed by several dimension columns, followed by every bit of info we store about the primary key"......
1
vote
Table structure with multiple foreign keys and values
A little more traditional :)
Have a list of objects combining Foo and Bar:
create table Objects (
oid primary key,
type check('Foo', 'Bar'),
);
create table Foo ( id references Objects(oid), name)...
0
votes
How to handle the deletion of records with "shared ownership"?
I think I agree with @Charlieface
In a real world scenario (and from my personal experience) you can easily delete when thy are single tenant but it gets messy in a multi tenant scenario.
And in my ...
9
votes
Table structure with multiple foreign keys and values
Neither of these options are good.
Not properly normalized.
Normalization is violated because you would need to repeat the package data once for each joining row.
You can never be sure which row ...
4
votes
Table structure with multiple foreign keys and values
A more traditional approach:
select *
from packages_tables ;
+------+------+----+
| pkg | Tipe | id |
+------+------+----+
| pkg1 | Foo | 1 |
| pkg2 | Bar | 1 |
| pkg2 | Bar | 2 |
| pkg3 | ...
0
votes
What value should I choose as length for timestamp without timezone in PostgreSQL?
By all means, use timestamptz instead!
timestamp (w/o timezone) stores a date and time for a calendar and a clock.
timestamptz (w/ timezone) stores a point in time, the EPOCH. It does not store the ...
1
vote
Could a Tool Like ChartDB Work for MongoDB Schema Visualization?
If there is an array inside an object that's a one-to-many relationship. One could build an ER diagram accordingly. A logical data model is different to a physical DB design. The tool could be useful ...
Top 50 recent answers are included
Related Tags
database-design × 6363mysql × 1461
sql-server × 877
postgresql × 796
schema × 446
normalization × 410
performance × 345
erd × 316
foreign-key × 225
relational-theory × 208
primary-key × 155
database-recommendation × 150
oracle × 148
index × 147
table × 128
data-warehouse × 116
query-performance × 114
nosql × 107
mongodb × 104
best-practices × 102
database-diagrams × 101
constraint × 98
optimization × 97
sql-server-2008 × 90
subtypes × 80