20100712: Upgrade to OSQA r516. Let me know if you experience any new issues. 20100708: Fixed the RSS feed.

What are common web applications in which a relational database is unavoidable?

It seems that one should, if possible, assume a non-relational database when doing initial design. That's because it is easier to move to a relational DB than from a relational DB. In what common scenarios is it impractical to use a non-relational DB?

asked Jul 03 '10 at 18:57

Joseph%20Turian's gravatar image

Joseph Turian ♦♦
916710


I think you need to use relational database when you want to enforce constraints or relationships between the data at the db level rather than handling in the application code.

Assume a consumer can have only 1 shopping cart or you cant delete the shopping cart if there items within it. A consumer can have 2 addresses CC address and Shipping address but should have at lease one. These all and more are constraints and relations between various entities and are easily achieved by a RDBMS. Similar example is cascade delete, if you have defined a relationship of entities and delete the parent object the RDBMS takes care of deleting the rest of child entities.

I think when you see there is a relationship in the physical world then it doesn't harm using a RDBMS, but the most common mistake people make is using a RDBMS even though there is absolutely no relation and is a flat data.

answered Jul 08 '10 at 22:52

techies's gravatar image

techies
161

Your statement at the end seems backwards to me. One important features of relational schema is for the database server to handle constraints. Given that most non-relational databases don't have constraints it seems it would be much hard to move to a relational DB because your data might have a large number of constraint errors.

But to answer your question, the most obvious reason you would need a relational database are for transaction support (e.g.: financial applications).

answered Jul 07 '10 at 15:29

Van%20Gale's gravatar image

Van Gale
11

I would agree that if your ultimate goal is portability between different databases (which I'm not sure why that would be) then designing with a NoSQL compatible model in mind, form the beginning, would be optimal. (more about this at the bottom of my reply) However, as to your question if there is a need for relational databases, I'm not sure.

@Van Gale mentioned that an obvious answers is when you need transactional support (for financial situations). This is true! However, I would not agree that you need a relational database for transactional support. Yes, RDBMS's already have good support for transactions, but that does not mean it is a feature that will never be supported by NoSQL databases. From a quick query on Google I found that Sedna and Neo (both NoSQL databases) support transactions. (I may be wrong on that, but that's what I gathered in my quick, short search.)

I would venture to say that there is NO situation which NEEDS or REQUIRES the use of a relational database. However, in some circumstances it is definitely beneficial to use a RDBMS, but I would not say that it is a requirement. For example, if you are creating a reporting program, I would imagine that using an SQL database would be to your advantage because of the querying capabilities that you already have given to you and where critical relationships are already enforced. If you were to use a NoSQL DB in this situation, you might find yourself having to write a lot of extra code to do what a RDBMS already does for you.

Also, as another side note, you mention that you should assume a non-relational database when doing initial design. I would not confuse NoSQL with non-relational. Almost all data in a database is related. What is the point of having a bunch of tables/collections/documents/etc. that are all mutually exclusive? Relations still exists in NoSQL databases whether they are enforced by the DBMS or not.

Well, I think that's about all I have to input on the subject. I hope it didn't sound too forward or talk too much. This is just my opinion, and I'm opening to hearing different opinions/arguments. Hope this helped!

answered Jul 07 '10 at 16:11

John%20Murray's gravatar image

John Murray
11

Joseph,

I think your premise is wrong indeed: you shouldn't assume a non-relational database as your first choice, in the same way you shouldn't assume a relational one; just analyze your domain and functional/non-functional requirements, and pick the right tool.

That said, there are a few kinds of applications where a relational database is probably best suited, in particular those with strong transaction requirements, but again, the application business domain is absolutely only one of the variables: there are other ones, from performance and scalability requirements to skills availability and tooling support.

answered Jul 09 '10 at 03:56

Sergio%20Bossa's gravatar image

Sergio Bossa
464

Thanks for taking the time to chat about this, I feel fervently about this and I benefit from learning about this subject. Please, as you gain information, please add to this blog with more information. I have found it really useful. true religion jeans

answered Mar 07 '11 at 20:45

fffffffffff's gravatar image

fffffffffff
1

Thanks for taking the time to chat about this, I feel fervently about this and I benefit from learning about this subject. Please, as you gain information, please add to this blog with more information. I have found it really useful. ugg slippers

answered Mar 07 '11 at 20:46

fffffffffff's gravatar image

fffffffffff
1

However, in some circumstances it is definitely beneficial to use a RDBMS, but I would not say that it is a requirement. For example, if you are creating a reporting program, I would imagine that using an SQL database would be to your advantage because of the querying capabilities that you ugg slippers already have given to you and where critical relationships are already enforced. If you were to use a NoSQL DB in this situation, you might find yourself having to write

answered Mar 08 '11 at 20:58

maicalljason's gravatar image

maicalljason
1

I have found it really useful. chi flat iron

answered Mar 14 '11 at 22:11

chi%20flat%20iron's gravatar image

chi flat iron
1

as you gain information, please add to this blog with more information. I have found it really useful. GHD Hair Straighteners

answered Mar 14 '11 at 22:11

chi%20flat%20iron's gravatar image

chi flat iron
1

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Tags:

×2
×1

Asked: Jul 03 '10 at 18:57

Seen: 1,272 times

Last updated: Mar 14 '11 at 22:11

powered by OSQA

User submitted content is under Creative Commons: Attribution - Share Alike; Other things copyright (C) 2010, MetaOptimize LLC.