Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools

What's my database? Flat or Relational?

Hello everyone,

I'm learning about databases and have taken up a little project to work with. My question is, how do I know if my database is Relational or Flat?

At the moment, the info I have is in a flat spreadsheet, but I've heard this may not be the best way to store it, as in the future it could be difficult to scale and cross-reference.

So, what questions do I need to ask to find out which way or the other?

thanks, sorry if that's confusing. But, welcome to my world. It's like this for me. 24/7

Thanks,

Philip

3 Answers

Brent Suggs
seal-mask
PLUS
.a{fill-rule:evenodd;}techdegree seal-36
Brent Suggs
Front End Web Development Techdegree Graduate 21,343 Points

Well I can tell you that an Excel sheet is never a good option for any kind of web related venture. You need to determine if this data is always going to be static or will be dynamic and if you'll want some kind of data control or quality catches. If the later then you need to look into a relational database ( MySQL, sqllite, etc... ) so that you can map the relations and implement data control rules.

hmmmmm... Thanks for your answer, but question was "how do I know if my database should be Relational, or Flat?" — What questions do I need to ask determine, in database design / planning that leads to a Relational or Flat solution?

At the moment, it looks like it'll be a Flat MySQL — but how can I be sure it's the right solution?

Brent Suggs
seal-mask
PLUS
.a{fill-rule:evenodd;}techdegree seal-36
Brent Suggs
Front End Web Development Techdegree Graduate 21,343 Points

Well MySQL is a relational database, so if you're using MySQL then you're not dealing with flat data. One of the big questions you need to answer is how much data you are going to be dealing with. If it's a relatively small amount then a flat file would be fine and faster, but if it's going to get larger or you are starting off with a large amount of data then you're going to want a relational database to handle the load.

Thanks Brent, you made some useful points. But, that makes me ask "how much data is relatively small data?" — I'm working on a directory of museums, and there will be 200+ museums to deal with, which will contain location details, details about exhibitions, the museum type etc etc..

Currently, been built the database in Filemaker (but admittedly, in a flat spreadsheet style) — it works ok in offline but I want to take it online.

I'm having to re-build the database because I seriously overlooked the construction of it to begin with. (live and learn) — Do you know much about Primary Keys, Foreign Keys etc? I think I need a bit of help joining them all up...

Thanks Brent, you made some useful points. But, that makes me ask "how much data is relatively small data?" — I'm working on a directory of museums, and there will be 200+ museums to deal with, which will contain location details, details about exhibitions, the museum type etc etc..

Currently, been built the database in Filemaker (but admittedly, in a flat spreadsheet style) — it works ok in offline but I want to take it online.

I'm having to re-build the database because I seriously overlooked the construction of it to begin with. (live and learn) — Do you know much about Primary Keys, Foreign Keys etc? I think I need a bit of help joining them all up...