Questions tagged [schema]

87 questions
62
votes
11 answers

Should I define the relations between tables in the database or just in code?

In my experience, many of the projects I have read in the past didn't have relationship definitions in the database, instead they only defined them in the source code. So I'm wondering what are the advantages/disadvantages of defining relations…
Yoshi
  • 747
  • 1
  • 5
  • 7
62
votes
6 answers

Is this a ridiculous way to structure a DB schema, or am I completely missing something?

I have done a fair bit of work with relational databases, and think I understand the basic concepts of good schema design pretty well. I recently was tasked with taking over a project where the DB was designed by a highly-paid consultant. Please let…
Jim
  • 1,997
  • 3
  • 20
  • 25
19
votes
1 answer

How should HTML data formats be applied in everyday situations?

Given Google's shift towards a stronger focus on page markup data, how do the data formats used in Schema.org work alongside those for Microformats? How do these (and other specs) compliment each other and which should be used in preference in…
Phil.Wheeler
  • 1,298
  • 3
  • 12
  • 20
15
votes
2 answers

Zero Downtime Deployment - Transitional Db Schema

Achieving Zero Downtime Deployment touched on the same issue but I need some advice on a strategy that I am considering. Context A web-based application with Apache/PHP for server-side processing and MySQL DB/filesystem for persistence. We are…
user174739
13
votes
4 answers

Are database schema migrations a problem in production environments?

In discussions about NoSQL vs SQL databases, I sometimes hear that companies prefer to use schemaless NoSQL databases because it is problematic to migrate the schema to a new version. But is that really a big problem when doing upgrades? Are…
Jonas
  • 14,867
  • 9
  • 69
  • 102
11
votes
3 answers

Database Schema for Pricing Products (packages, promotions, qty based, limited time offer...)

I'm working on a new point of sale for a company that products for different prices depending on the product mix. All products have a base price. To explain my problem, I will use the following info: Product Category Price A …
cml
  • 111
  • 1
  • 1
  • 4
10
votes
7 answers

What's the difference between using RDFS/OWL versus XML?

I was wondering what advantages the ontology languages of RDFS/OWL has over using a tagging/markup system (such as http://www.schema.org/) for managing and creating metadata?
10
votes
8 answers

Refactoring or upgrading databases to handle new features

Several responses to a database schema question, suggested an additional table to normalize a database for a feature that is not part of the current requirements (A UserDepartment table to allow for a many-to-many relationship between…
JeffO
  • 36,816
  • 2
  • 57
  • 124
9
votes
3 answers

How to manage database schema changes in open source project releases

I manage an open source PHP/MySQL web application used by a few K-12 schools and some colleges. I'm also the project's only developer. While it used to be little more than a source download of an application my employer hosts, I've worked over the…
Michael
  • 1,327
  • 3
  • 13
  • 21
9
votes
5 answers

Use UUID on top of auto increment ID

I am trying to design the DB schema of my new project and I need some suggestions. I am thinking to have one extra column for some tables which is a UUID. I wanted mainly for tables which contain data which are accessible through REST, so I don't…
pik4
  • 365
  • 3
  • 13
9
votes
2 answers

Database model for keeping track of likes/shares/comments on blog posts over time

My goal is to keep track of the popular posts on different blog sites based on social network activity at any given time. The goal is not to simply get the most popular now, but instead find posts that are popular compared to other posts on the same…
gage
  • 91
  • 1
  • 1
  • 2
8
votes
12 answers

Over normalization in database

Currently I am working on creating a new database schema as part of a major new product. Our previous customer address records (in a previous product) look something like this in our current schema (not all columns shown): AddressID, AddressLine1,…
Jon Raynor
  • 10,905
  • 29
  • 47
7
votes
2 answers

How to define and share a JSON schema between the front-end and back-end of an application?

We have a mobile app that accepts input into some fields, formalises them as a JSON document and then sends it to the back-end for processing. We want to agree on a schema for this document that can be validated and referenced indirectly in both the…
Nobilis
  • 179
  • 1
  • 6
6
votes
2 answers

Best practice to include XSD in C# project

I have an XSD schema I need to include within my program, to validate some user input XML. The schema will need to be regularly updated. (By the programmer.) My current method to include this is hold a reference to it within Resources.resx -…
Chris
  • 196
  • 1
  • 2
  • 8
6
votes
4 answers

How to handle unexpected schema changes to production database

Is it a common or normal practice to encounter schema changes, especially renamed or removed columns, in a production database, without having been notified of the change? If unexpected schema changes are anticipated in the production database, how…
Bratch
  • 202
  • 1
  • 10
1
2 3 4 5 6