Skip to main content
added 1213 characters in body
Source Link
Evan Plaice
  • 5.8k
  • 2
  • 28
  • 34

NoSquare Peg, Round Hole

I can see how creating a mapping like this simplifies thinking about the data, but I also feel it restricts you to thinking about the data in only this way. How conforming do you make your database tables to data structure(s), if at all?

I don't conform the database, at all. Assuming the benefits to be gained from a particular data structure in code can be mapped directly to the database is a failure to understand the strengths of databases.

It's a good idea to represent data in it's truest form, stripped of implementation because the implementation will most likely change over time.

The simple rule is,"separate data from implementation".

Should databases be viewed as realms of raw data that are to be shaped and molded (translated) to data structures selected dependent on the program's purpose?

Ask yourself this, is it a good idea to attach the database table schema to. Would you duplicate all of the data returned fromfunctionality of a query? Maybedatabase in some niche cases butcode (including indexing, primary keys, foreign keys, etc)? Of course not, because in general it's just unnecessary overheadthe context of the program they don't add any value.

All you want is data matching the parameters you input.

It's best to model the structure of the database in the best possible manner for storage retrieval, and model the data structures in the application in the best manner for how itthey will be used in code.

You won't understand how to build an ideal database until you gain a firm understanding of what databases are designed to accomplish.

The point is, there is no 1-1 mapping from DB to any data structure. The database could be considered it's own type of higher level special purpose data structure based on a whole collection of lower level data structures.

No

It's a good idea to represent data in it's truest form, stripped of implementation because the implementation will most likely change over time.

The simple rule is,"separate data from implementation".

Ask yourself this, is it a good idea to attach the database table schema to the data returned from a query? Maybe in some niche cases but in general it's just unnecessary overhead.

It's best to model the structure of the database in the best possible manner for storage retrieval, and model the data structures in the application in the best manner for how it will be used.

Square Peg, Round Hole

I can see how creating a mapping like this simplifies thinking about the data, but I also feel it restricts you to thinking about the data in only this way. How conforming do you make your database tables to data structure(s), if at all?

I don't conform the database, at all. Assuming the benefits to be gained from a particular data structure in code can be mapped directly to the database is a failure to understand the strengths of databases.

It's a good idea to represent data in it's truest form, stripped of implementation because the implementation will most likely change over time.

The simple rule is,"separate data from implementation".

Should databases be viewed as realms of raw data that are to be shaped and molded (translated) to data structures selected dependent on the program's purpose?

Ask yourself this. Would you duplicate all of the functionality of a database in code (including indexing, primary keys, foreign keys, etc)? Of course not, because in the context of the program they don't add any value.

All you want is data matching the parameters you input.

It's best to model the structure of the database in the best possible manner for storage retrieval, and model the data structures in the application in the best manner for how they will be used in code.

You won't understand how to build an ideal database until you gain a firm understanding of what databases are designed to accomplish.

The point is, there is no 1-1 mapping from DB to any data structure. The database could be considered it's own type of higher level special purpose data structure based on a whole collection of lower level data structures.

Source Link
Evan Plaice
  • 5.8k
  • 2
  • 28
  • 34

No

It's a good idea to represent data in it's truest form, stripped of implementation because the implementation will most likely change over time.

The simple rule is,"separate data from implementation".

Ask yourself this, is it a good idea to attach the database table schema to the data returned from a query? Maybe in some niche cases but in general it's just unnecessary overhead.

It's best to model the structure of the database in the best possible manner for storage retrieval, and model the data structures in the application in the best manner for how it will be used.