I am working for a website company that uses data structures heavily, as opposed to databases. Could someone help me understand the difference between these two? I am recruiting for this company, but am a non-technical person.
Software/Hardware used:
Java, Linux, PHP
ASKED:
July 19, 2010 8:20 PM
UPDATED:
July 23, 2010 12:57 AM
I’m not at all clear on the context. Databases and data structures are usually two different levels of levels of concepts.
For example, you can have vehicles and automobiles. While they can refer to the same object, it should be understood that “automobiles” can be at a level below “vehicle”.
But then, automobiles have “seats”. Now, “seat” is a component of an “automobile” (though not strictly required). And “seats” can certainly exist completely apart from any “automobile”.
Generally, databases are collections of data structures that are organized and managed through a DBMS (DataBase Management System), e.g., DB2, Oracle or SQL Server — three RDBMSs (Relational DBMS). There are other kinds of DBMSs, such as Object-Relational DBMSs and more.
SQL is a language for managing a relational database. It is used to create TABLEs which are generally collections (rows) of data structures that are the same, e.g., one row for each customer where the customer row consists of a data structure that consists of the attributes (columns) that describe each customer. TABLEs may be grouped into SCHEMAs — collections of related TABLEs, often for the benefit of a particular application.
A database of medical records might contain a PATIENT TABLE with a row for each patient, but also documents such as X-ray images. The DBMS should provide a means for retrieving particular X-rays for a PATIENT, or for past BILLINGS for a PATIENT, or for any number of other kinds of entities.
Each kind would have a particular data structure. A structure for a PATIENT wouldn’t be the same as one for BILLINGS. There would be a relation that described both of those in order to know which BILLINGS belonged to which PATIENT. A PATIENT data structure would include some unique identifier — PATIENT_ID — that should also be an attribute of BILLINGS. A row read from BILLINGS would have a PATIENT_ID that allowed for retrieval of the specific data structure (row) for the PATIENT that the bill was for.
Anyway, I’m just rambling in order to say enough about how databases and data structures are related so that you might say something more about the context where you see them as not being related. I don’t do any significant web development, so I’m not familiar with how terms might be used differently.
Since no one else has said anything, I’m either not alone or everyone else thinks it’s so fundamental that this must be a homework question!
Tom
TomLiotta – appreciated your answer until I got to the end and read your completely arrogrant, condescending statement. I hope it made you feel terribly smart by writing it
Yes, maybe Snc should ask them exactly what they mean, but, I’m afraid he/she is not going to (fully) understand the answer.
Maybe they are talking about data structures they use to store non-persistent data in memory, such as arrays, linked lists, or similar…
Some clarification is definitely needed.
I hope it made you feel terribly smart by writing it…
I apologize for unintended implications. Seriously, I’m 35(+) years out of college and somewhat entrenched in the procedural world. I honestly wouldn’t have been surprised at all to see an admonishment that I was completely misunderstanding a ‘modern’ usage of “data structures”.
I’ve answered a couple questions here only to see question and answer disappear because it was judged by moderators to be “homework”.
Carlosdl understands my unfortunate position, I think. I’m completely happy to have a dialog (or polylog?) to dig into finer points that might be important.
Tom
Simple answer: Databases are repositories for data; data-structes not meant to hold data. DS just defines the layout of a set of fields. Its only a structure.
“Simple answer: Databases are repositories for data; data-structes not meant to hold data. DS just defines the layout of a set of fields. Its only a structure.”
But, Snc wrote this:
“I am working for a website company that uses data structures heavily, as opposed to databases”
So, that is probably not what they mean by data structures.
When I think of data structures, think the logical data objects in a database: i.e. a table is a data structure- it contains logically structured data so it can be queried against and combined and manipulated in various ways with other data structures. If it weren’t for data structures, we’d just have a big jumbled up pile of data- not having any organized meaning.
Data modeling involves figuring out the logical definition of the business objects that will be represented by the data structures (i.e. Car has serial number, engine, transmission, wheels, etc.) so we might have a table (data structure) named ‘Car’ with the fields: serial number, engine, transmission, wheels, etc.)
The database is the repository for all the data relating to Car and any other structures that may be part of the business.
In your situation, I don’t know how data structures can be used “instead of data bases” unless they are misusing the terminology. “Database” is a general term for repository of data whether that be a full-blown DBMS like SQL Server or a simple CSV file.
Good luck.
Hi Scott – thank you for your input.
I spoke with my supervisor about this yesterday, and he informed me that data structures are housed in memory and can be “easily” accessed when our users are on our website (hence, his reasoning behind our company relying heavily on data structures instead of databases).
Still confused…
Also, what book would you recommend for myself (a lay person) to better understand the way computers work? I think that would be helpful for me.
Thank you!!!!!!
It seems that my first guess wasn’t too wrong.
So, you will have to look for people with the appropriate knowledge to utilize memory data structures in the specific language that the company uses for web development, which could be more important than the knowledge they could have on SQL (most common language used to query/manipulate databases).
Not only specific language, but potentially the specific web/application server and the specific platform both might be important. Accessing data structures in memory through web access would require appropriate configuration and programming.
Tom
Well, again, it all depends on what we mean by ‘data structures in memory’.
A simple array would be a data structure, and it is stored in memory, and most web/app servers and programming languages permit the use of arrays without additional configuration changes.
But, if we are talking about accessing specific memory addresses and/or managing memory at a lower level from a web application, then that would a completely different story, I think.
Yes, I think I see where this is going… something like memory resident only data or web services probably hold the data- maybe even XML files on the web server.
I remember looking at a language called Ruby on Rails which seemed to generate memory-resident data structures for application data but did not rely at all on data files or a full-blown DBMS.
Anyway, I don’t know much about this method of data creation or management. I only know of one other person who has used Ruby on Rails but I think it has a small following and limited usefulness for most applications- so I’m guessing it will be hard to find someone qualified in this area. I may be wrong though.
You asked about a book- If you are really a computer novice, I recommend: “How Computers Work (9th Edition) by Ron White, and Timothy Edward Downs.” This covers all the basics and it is written for the lay person and primarily covers PC concepts (but most things discussed apply to all other systems- just at larger scales), I read it about 10 years ago and thought it was great (although it was an older version).
Good luck!