Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does 'relational' in 'relational database' mean for us?

I know, relational database is a database where fields in one table are linking to rows in the others, something like this.

But I can't understand what does it mean for me as a web developer!

As I know, a query with joins and nested select can reduce perfomance (especially drupal-style queries with dozens of joins). Even more, any queries to DB are bottlenecks, and then you have lots of users you have to cache every select request.

If you cache every select request, it's better to cache simple requests rather than complicated. You can either cache "select * from tbl1 where id = 123" and "select * from tbl2 where id = 456" or "select * from tbl1, tbl2 where ...", but if you choose the second way, you'll need to cache every combination of objects - it isn't cool.

Ok, now we use only very simple queries like "select * from tbl1 where id = 123" of "select id from tbl1 order by id limit 0, 30" and cache them (or we can cache only the first type of queries, whatever). There queries and not less simple INSERT, DELETE and UPDATE are all what we need and all what we use!

As we can see, all the relational logic are in the main language of the application, not in SQL. So, why do we need all this relational things? What do they mean? What do "relational" type has what another types hasn't but it is needed? If we don't use relational features, why do everyone still use MySQL or whatever relational databases, even if he care about the perfomance?

This type of databases has become a standard. Why? I have no clue. I've hardly ever heard about somebody using non-relational database, except for the on in GAE.

Am I missing something?

like image 522
Valentin Golev Avatar asked Nov 06 '09 19:11

Valentin Golev


People also ask

Why relational databases are called relational?

A relational database is a type of database that stores and provides access to data points that are related to one another. Relational databases are based on the relational model, an intuitive, straightforward way of representing data in tables.

What is a relational database where it is used and what is its importance?

Relational databases are a type of database that allows users to access data that is stored in various tables connected by a unique ID or “key.” Using this key, users can unlock data entries related to that key on another table, to help with inventory management, shipping, and more.

What is a main benefit of relational databases?

1 – Simplicity of Model In contrast to other types of database models, the relational database model is much simpler. It does not require any complex queries because it has no query processing or structuring so simple SQL queries are enough to handle the data.


1 Answers

If you want to learn about what relational means, I recommend the book "SQL and Relational Theory" by C. J. Date.

Relational in this context doesn't refer to relationships. It refers to relations which are basically what tables are called in the mathematical theories that led to the relational model.

The reason that relational databases have become ubiquitous is that they are the most general-purpose solution for organizing data with minimum redundancy.

There are valid reasons to use non-relational solutions. They often solve specific tasks of data-management extremely well, but are weak in other areas. Whereas SQL and relational databases strike a compromise, solving a larger set of problems adequately, with fewer areas of weakness.

Other technologies currently available that are not based on the relational model are listed in "The Next-Gen Databases."

like image 120
Bill Karwin Avatar answered Nov 08 '22 23:11

Bill Karwin