Internet Basics: A Database-driven Website Is Like A Sandwich Machine
Ever come across one of those sandwich machines when you?re hungry? You know, it?s like a soda machine except it sells sandwiches.
There?s all these different kinds of sandwiches just sitting in the machine waiting to be picked ? rows and rows of sandwiches, each in its own little area.
While you?re deciding whether to get corned beef or tuna, someone else comes along and selects egg salad. The egg salad sandwich pops out the slot at the bottom of the machine. Finally, you pick tuna. The tuna sandwich pops out the slot at the bottom. Same slot. Different sandwich.
That?s what a database-driven website is like.
It has webpages that have slots in them. The slots are empty. But when you come to the site and choose this or that option, the slots get filled with whatever you picked, just like the tuna sandwich. Same webpage. Same slots. Different content.
And just like the individual sandwiches in the sandwich machine, the content is stored in rows with each piece of information in its own little area in what?s called a database. A database is just a big sandwich holder, except it can hold other things too, like username/password combinations, license numbers, names, ages, dates, photos, and so on.
And with a database-driven website, a single webpage can have its empty slots filled with this bit of info, or that bit of info, or the next bit of info. Each time the page loads, it looks different ? it?s the same page with the same slots, just filled up with different stuff from the database each time.
The alternative is to have a specific webpage for each piece of information, but that can be very inefficient. That?s like having an egg salad sandwich machine, and a corned beef sandwich machine, and a tuna sandwich machine, and so on. Then when you wanted to get a sandwich, you?d have to go to the right machine, instead of one machine offering you all you want and more. Same with a database-driven website. One page can deliver multiple offerings. Yummy!
And that?s why a database-driven website is like a sandwich machine.
Copyright (c) Grant Pasay 2005. All rights reserved.
About the Author: Grant Pasay is a writer, musician, moviemaker, and author of the new eBook, "The Internet Is Like A Refrigerator: And Other Weird Comparisons That Make it Easy to Understand Everything From AOL to Zip Files." Check out Grant's free/brandable ebook at: http://grantpasay.com/refrigerator/
Check out Grant at: http://grantpasay.com/