Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

SQL and NoSQL are Two Sides of the Same Coin

Unknown Lamer posted more than 3 years ago | from the dualistic-monadic-monsters-from-the-sea dept.

Databases 259

An anonymous reader writes "NoSQL databases have become a hot topic with their promise to solve the problem of distilling valuable information and business insight from big data in a scalable and programmer-friendly way. Microsoft researchers Erik Meijer and Gavin Bierman ... present a mathematical model and standardized query language that could be used to unify SQL and NoSQL data models." Unify is not quite correct; the article shows that relational SQL and key-value NoSQL models are mathematically dual, and provides a monadic query language for what they have coined coSQL.

cancel ×

259 comments

Sorry! There are no comments related to the filter you selected.

microsoft research rocks (2)

JonySuede (1908576) | more than 3 years ago | (#35750848)

microsoft research rocks but the product division usually sucks !

Whatever (-1)

Anonymous Coward | more than 3 years ago | (#35750922)

SQL isn't hard. The people who complain about it and want a better way are just the people who never bothered to learn it.

Re:Whatever (1)

JonySuede (1908576) | more than 3 years ago | (#35750940)

no but when you are working with objects
it is cumbersome to have to write into unchecked string.

Re:Whatever (1)

TemporalBeing (803363) | more than 3 years ago | (#35751216)

no but when you are working with objects it is cumbersome to have to write into unchecked string.

Then you're doing it wrong.

Re:Whatever (1)

JonySuede (1908576) | more than 3 years ago | (#35751450)

When you have to support legacy data and applications any way you do it, you are doing it wrongly.

Re:Whatever (0)

Anonymous Coward | more than 3 years ago | (#35751492)

I have seen the pipe used as a field marker since adding a columns was to costly at the time. Try your fancy orm for a join on this

NoSQL is great when hiring developers. (2, Insightful)

Anonymous Coward | more than 3 years ago | (#35751228)

I really like NoSQL. It's a great tool to use when deciding whether I should hire a given software developer, or whether I should move on to the next candidate. All I have to do is ask the person what he thinks about NoSQL. If he gives a positive response, I send him on his way. If he points out its many flaws, I'm often tempted to hire him instantly. After all, those who dislike NoSQL the most generally know how to write good SQL queries, and they know how to use relational databases properly. They're the kind of people I want to hire, even if the position doesn't involve databases much. It just goes to show that they care about quality, that they care about knowing how to use their technology well, and that they care about doing the job properly.

Re:NoSQL is great when hiring developers. (2)

Sarten-X (1102295) | more than 3 years ago | (#35751502)

That's okay... Facebook, StumbleUpon, and Twitter will be thrilled to have you pre-screening their applicants to weed out those who refuse to break tradition in the search for improvement.

Re:Whatever (1)

sapgau (413511) | more than 3 years ago | (#35751628)

+1

Re:Whatever (1)

nschubach (922175) | more than 3 years ago | (#35752000)

See my sig. There are some parts of SQL that bug the snot out of me.

Re:microsoft research rocks (1)

jbolden (176878) | more than 3 years ago | (#35751364)

I agree. Their research division is amazing. If they implemented 10% of what came out of their research division they would have the coolest sites around.

Re:microsoft research rocks (2)

Draek (916851) | more than 3 years ago | (#35751530)

No, just their software. Their mice and keyboards are second to none, and I know more than a few gamers that wouldn't touch an X360 with a ten-foot pole but still keep one of its controllers plugged in their PCs.

Re:microsoft research rocks (1)

nschubach (922175) | more than 3 years ago | (#35752010)

I've loved my Logitech mice/keyboards way more than any MS hardware. (I think there was even a point early on when Logitech made MS mice?)

Also, wouldn't touch a 360, nor the controller.

Re:microsoft research rocks (1)

CastrTroy (595695) | more than 3 years ago | (#35752414)

Obligatory Penny Arcade [penny-arcade.com] . The original XBox controllers were terrible.

Re:microsoft research rocks (0)

Anonymous Coward | more than 3 years ago | (#35751566)

microsoft research rocks

orly? that paper is full of fail.

Let me too coin a phrase... (1)

Chris_Stankowitz (612232) | more than 3 years ago | (#35750858)

coSQLInjection (cSQLI)

Has a nice ring to it.

You forgot the inverse tachyon pulse (4, Insightful)

0p7imu5_P2im3 (973979) | more than 3 years ago | (#35750874)

An inverse tachyon pulse would disperse the relational quantum silica into a focused warp field, thus purging all forms of slipstream space based SQL databases from subspace.

Re:You forgot the inverse tachyon pulse (0)

Anonymous Coward | more than 3 years ago | (#35750958)

Words! Good god, so many words!

Re:You forgot the inverse tachyon pulse (0)

Anonymous Coward | more than 3 years ago | (#35752300)

Dammit Jim I'm a database admin not a physicist.

Curse of Java developers (-1)

Anonymous Coward | more than 3 years ago | (#35750876)

NoSQL's existence is purely for one and one reason only - the goddamn java developers who never ever even tried to understand what relational DBMS is and how to use SQL.

It boggles mind to read this in the summary: "solve the problem of distilling valuable information and business insight from big data in a scalable and programmer-friendly way".

Yeah - lets get rid something capable and reinvent something else just because we can't figure out how to use it.

assholes.

Re:Curse of Java developers (0)

Anonymous Coward | more than 3 years ago | (#35751032)

Or those developers never heard of a reporting database (for lack of a better term) or a data cube. I remember having a reporting database server. The hardware was even setup differently. The reporting server was mostly reads while the transactional database system was a hell of a lot more writes. We had different RAID systems on each server. One for better write performance the other favored reads. Every night the last days data was copied to the reporting system. All the data cubes were updated. All the reporting tables were also updated. The reporting tables often summed up the data to make it easier for the marketing people to understand.

I am weary of anything Microsoft (-1, Flamebait)

bogaboga (793279) | more than 3 years ago | (#35750888)

Microsoft researchers Erik Meijer and Gavin Bierman ... present a mathematical model and standardized query language that could be used to unify SQL and NoSQL data models."

Maybe we should add...

"in an [impossible] exploratory effort to embrace, extend and extinguish..."

at the end of the sentence as they have done in the past.

Re:I am weary of anything Microsoft (1)

badboy_tw2002 (524611) | more than 3 years ago | (#35751018)

Epic M$ hate bro. There's a new web board forming called "Slash-dot" and I hear they're going to open up a comment section. You should check it out, I think you'd do well there. BTW, do you think there's anything to this "Y2K" problem or what? Either way I'm going to "party like its 1999"! :)

Re:I am weary of anything Microsoft (0)

Anonymous Coward | more than 3 years ago | (#35751908)

Rich!

Re:I am weary of anything Microsoft (0)

Ant P. (974313) | more than 3 years ago | (#35751078)

They don't need the 3 e's any more - they just make up bullshit like this, spam it everywhere until people start to use it, then surface their submarine patents.

Re:I am weary of anything Microsoft (0)

Anonymous Coward | more than 3 years ago | (#35751818)

Weary, or wary? (or maybe both?)

Re:I am weary of anything Microsoft (0)

Anonymous Coward | more than 3 years ago | (#35751838)

:-) The team is actually in a product group and we are doing this for real :-))

Re:I am weary of anything Microsoft (1)

c0lo (1497653) | more than 3 years ago | (#35752016)

Microsoft researchers Erik Meijer and Gavin Bierman ... present a mathematical model and standardized query language that could be used to unify SQL and NoSQL data models."

Maybe we should add...

"in an [impossible] exploratory effort to embrace, extend and extinguish..."

at the end of the sentence as they have done in the past.

TFA

CONCLUSION

The nascent noSQL market is extremely fragmented, with many competing vendors and technologies. Programming, deploying, and managing noSQL solutions requires specialized and low-level knowledge that does not easily carry over from one vendor's product to another.

Notes:
1. nothing to embrace in this phase... actually too many to embrace, thus not yet a "standard"
2. can't stop to note that all the examples are LINQ-based. Is this an attempt to grow LINQ in a "standard"?

Let me guess: +4, Discouraging (-1)

Anonymous Coward | more than 3 years ago | (#35750908)

MMMMMonnnnnaaaaaddddddddddssssssssssssssss.

UUUGGGGGGHHHHH!

Yours In Novosibirsk,
K. Trout, C.F.O.

The real reason people like noSQL... (3, Insightful)

MrEricSir (398214) | more than 3 years ago | (#35750926)

...is that SQL sucks as a language. It's not terribly expressive, the ordering of arguments is inconsistent, and whoever designed the way JOIN works should be in jail.

Frankly, I'd like to see SQL die and get replaced with something more modern. We don't program in Cobol anymore, so why the hell are we still using SQL?

Re:The real reason people like noSQL... (0)

Anonymous Coward | more than 3 years ago | (#35750946)

Of all database query languages, SQL is the worst - with the exception of all the others.
(apologies to Winston Churchill)

Re:The real reason people like noSQL... (4, Insightful)

Anonymous Coward | more than 3 years ago | (#35750980)

so why the hell are we still using SQL?

Why are we still using C? Why are we still using HTML? Why are we still using FORTRAN (in the scientific community)? Same reason.

Might add that all these - C, HTML and FORTRAN - are still being updated, with new standards. So is SQL. It's really the same thing, and they all stick around for the same reasons, too.

Endless debate (3, Insightful)

alex67500 (1609333) | more than 3 years ago | (#35751350)

There are only 2 types of languages:
- those people bitch about, and
- those no one ever used

Re:The real reason people like noSQL... (5, Insightful)

sexconker (1179573) | more than 3 years ago | (#35751024)

We DO still program in COBOL.
And we DO still use SQL.
And we do so because it works.

Not only does SQL work, it is the best at what it does.

The only people who hate on SQL are the people who don't understand databases.
Generally, these are the same people who like labels, tag clouds and ruby on rails.
They produce a lot of high level hand waving with regards to the actual code and endless amounts of "herp derp I dunno" when asked why their shit performs slower than the 10 year old system it's supposed to replace. These are bad people.

What really pisses me off is that everyone fucking agreed with me until Android came out, then suddenly Java was cool, the performance was considered "good", and the quality of code and coders that it tends to bring about is now the acceptable norm.

Re:The real reason people like noSQL... (0)

Anonymous Coward | more than 3 years ago | (#35751174)

My experience is that code quality is poor at most shops regardless of language. I don't see anything particularly *good* about the quality of code C/C++ coders produce in comparison to Java. If you want to talk about languages that have some really horrible quality, let's talk about Javascript. Sure, it's not considered a "real" language by a lot of people but we're starting to see real usable applications written with it as one of the primary tools. Javascript is so slopped together it's just frightening.

Re:The real reason people like noSQL... (1)

TemporalBeing (803363) | more than 3 years ago | (#35751264)

Here, here. Wish I could give you some mod points.

Re:The real reason people like noSQL... (0)

Anonymous Coward | more than 3 years ago | (#35751972)

fyi: "hear, hear"

Re:The real reason people like noSQL... (1)

MrEricSir (398214) | more than 3 years ago | (#35751278)

The only people who hate on SQL are the people who don't understand databases.

That's a lot like saying people who don't like washing their clothes by hand don't like wearing clean clothes. Just because you enjoy doing something in a painful way doesn't mean that it's the best way to do it.

Re:The real reason people like noSQL... (3, Insightful)

DogDude (805747) | more than 3 years ago | (#35751398)

It's not painful. It's just different than what web developers doing "select *" are used to. As a system, it works well for tiny projects, all the way to the largest databases in the world. In the world of "develop it now, deal with problems later", people just can't be bothered to learning the right way to do something.

Re:The real reason people like noSQL... (0)

g4b (956118) | more than 3 years ago | (#35751606)

Maybe the truth is, that there are still unknown sides of programming we don't really know of. We are still the first generations toying with this idea, experiencing emerging technology on the run.

Programming becomes much more of an art, like the mathematical rhytm of frequences creates music out of distortion. For somebody who loves databases, and see them from the perspective of SQL, it becomes beautiful - and this person might know what is wrong with the language, if asked. At the same time, developing solutions that are actually secure and use simple code, things like django really help to blend away another kind of thinking, which this person is not interested in. Because he works on another layer of the art. As does the Java developer.

Optimizing SQL in an existing framework made those 10 year old things perform better.

Calling others stupid is easy. But don't tell others what is pain, and what is not, is my answer to both universes.

Re:The real reason people like noSQL... (4, Insightful)

DavidTC (10147) | more than 3 years ago | (#35751296)

There are a few things with SQL that could be done better, and there's still some standardization needed. I'd like to see a SQL 2012 standard or something.

But you're entirely right. There is one place nosql makes sense, and it's gigantic data stores like facebook and google, where the quantity is overwhelming, and the quality isn't that important...it's okay miss a few things, and you're looking for sorta-random stuff. That is why NoSQL was invented.

No one should ever 'choose' to use NoSQL...if you're on the size of a project that needs NoSQL, I promise you you are nowhere near that decision...it will be decided between the seven project architects as they buy thirty servers to run the damn thing. That's the guys who have a legit need, or at least it's a legit option, of using NoSQL.

It's not useful for any other system in existence.

It's especially funny when toy projects try to use NoSQL. It's like idiots trying to run their watches off geothermal power. 'It's free power! FROM THE EARTH!'

Dude, you're using half an amp, perhaps you should learn how to use a watch battery instead of driving 2 mile polls into the ground as you walk around. It's not like SQL is fucking rocket science. In fact, right now, NoSQL is actually more complicated to use.

Not to mention... (0)

Anonymous Coward | more than 3 years ago | (#35751508)

The quantity is overwhelming and also conveniently broken into an overwhelming flood of users with relatively trivial needs, localized data access patterns, and little need for synchronization. These consumer mass-media aspects are what allow the embarrassingly parallel solution that is "scale out".

Re:The real reason people like noSQL... (2)

Sarten-X (1102295) | more than 3 years ago | (#35751620)

And yet, one of my toy projects in grad school generated over a billion data points that needed analysis. The only database server I had access to choked on the first analysis pass (of about a dozen). It took about three months of processing to get to a point that could even be considered acceptable. Since then, on a whim, I've redone the program using Hadoop and HBase. A MapReduce job completed the analysis, on worse hardware, in less than a day. A major contributing factor was the lack of a rigid structure in HBase, which greatly improved the organization of data.

NoSQL solutions are certainly not the best tool for every job, but neither are normal relational databases. In my opinion, it's worthwhile to be familiar with both, and to be able to choose the right one for every task.

Re:The real reason people like noSQL... (1)

k8to (9046) | more than 3 years ago | (#35752204)

Funny, as I fire up my mutt mail client and instantly open enormous mailboxes by that are backed by nosql caches in tokyocabinet. I guess my personal mail is really a problem that requires 7 architects and 30 servers.

Oh wait...

Yeah, you could do this with a sql engine, like postres, or an in process sql approach like sqlite, but the keyval store actually maps much more closely to the problem, and the memory consumption is kept *very* low even for hundreds of thousands of messages. Just bringing postgres up without any data in it would cost about an order of magnitude more ram.

So nosql does make sense in other usage domains. Its just a matter of being careful in identifying when its the right KIND of tool, and further being careful in selecting the right nosql tool, since many are quite dissimilar.

Re:The real reason people like noSQL... (0)

Anonymous Coward | more than 3 years ago | (#35751344)

Java's never been cool.

Re:The real reason people like noSQL... (2, Informative)

lakeland (218447) | more than 3 years ago | (#35751528)

And we DO still use SQL. And we do so because it works

I disagree.

There are some things which are fast for a computer to do but are slow and awkward to do in SQL. You can see quite a few of them in SAS supported by data steps (e.g. decent RBAR support). Another is say I want to get the latest transactions for each customer, I have to do something like

select customer_id,max(txn_datetime) latest_txn_datetime
from fact_txn
group by customer_id

-- I've now got the latest transaction time but because system reversals and the like are often set to happen at the same time as the transaction I have to next...

select customer_id,max(txn_key) latest_txn_key
from fact_txn
join (select customer_id,max(txn_datetime) latest_txn_datetime
from fact_txn
group by customer_id) latest_txn
on (fact_txn.customer_id = latest_txn.customer_id)
where fact_txn.txn_datetime = latest_txn.latest_txn_datetime
group by fact_txn.customer_id

-- Now we've got the right transaction key, but we still have to join again to get the actual transactions

select fact_txn2.*
from fact_txn fact_txn2
where exists
    select 1 from
(select customer_id,max(txn_key) latest_txn_key
from fact_txn
join (select customer_id,max(txn_datetime) latest_txn_datetime
from fact_txn
group by customer_id) latest_txn
on (fact_txn.customer_id = latest_txn.customer_id)
where fact_txn.txn_datetime = latest_txn.latest_txn_datetime
group by fact_txn.customer_id) txn_keys_of_interest
where fact_txn2.txn_key = txn_keys_of_interest.latest_txn_key;

I can tidy this up a bit if needed - using CTEs or whatnot but the simple fact remains that a lot of the time I want to write a one liner like:

select * from fact_txn having txn_key = max(txn_key) over (PARTITION by customer_id order by txn_datetime)

Re:The real reason people like noSQL... (2)

angel'o'sphere (80593) | more than 3 years ago | (#35751632)

Lol,

that was water on the wheels of the other posters you agree: most people have no clue about programming and SQL.

If one of your main use cases is to find the "latest transaction" of your customer, then adapt your database to support that use case.

Sorry, your example makes no real sense at all.

angel'o'sphere

Re:The real reason people like noSQL... (2)

geekpowa (916089) | more than 3 years ago | (#35752162)

Actually, the example makes perfect sense and it is a problem I've encountered regularly and one of my many bug bears with SQL.

The generalized problem is 'find last txn' for every customer before date X.

Now if you can access the btree directly, you can efficiently walk it and get this data. But with SQL you cannot efficently get it. PostgreSQL windowing functions make getting such data simple in terms of constructing the SQL (once you get your head around windowing functions), but these queries walk large sections of the dataset and are not optimized fully.

The parents actual example is 'find latest txn'. This can be simplified by materializing details of the last transaction to the customer record on update. But this only works for this specific case. The generalised problem is not readily solved in SQL or at least I have not found a nice solution. The best I can come up with is to materialize data for a given date granularity; (i.e. first of every month). It works to a degree, but the solution is ugly and I know better solutions are possible (depending on cardinality of the data) if you are closer to the metal and are able to bypass the SQL layer.

Re:The real reason people like noSQL... (2)

sapgau (413511) | more than 3 years ago | (#35751826)

You are comparing a query from a transactional system vs. a dimensional one.

To achieve this you have to extract your transactional data and build the cubes needed for the query. Yes it will take a few hours every night to build the cube but your dimensional queries will be fast, efficient and wont bog down the transactional databases.

Re:The real reason people like noSQL... (1)

jchernia (590097) | more than 3 years ago | (#35751978)

Much simpler would be

select fact_txn.*
from fact_txn txn, (select customer_id,max(txn_datetime) from fact_txn group by customer_id) latestTxn
where txn.customer_id = latestTxn.customer_id and txn.txn_datetime = latestTxn.txn_datetime

not ANSI, I know, but should be portable to most dataservers

Re:The real reason people like noSQL... (0)

Anonymous Coward | more than 3 years ago | (#35751880)

Hey, Java can be acceptably fast if you code it in C.

Re:The real reason people like noSQL... (2)

shic (309152) | more than 3 years ago | (#35752168)

I must take issue with the claim that "The only people who hate on SQL are the people who don't understand databases."

I think you should take some time and read the extensive publications of Chris Date [wikipedia.org] (of Codd and Date International [codd-date.net] fame) - which, without exception, are extremely critical of SQL (while praising the relational model.)

SQL has its place - but it is far from perfect... and, the 'shackle of compatibility' prevents most of what is counter-productive about SQL from being fixed. NOSQL, while an infant technology, at least shows promise... only by starting afresh can we establish better DBMS strategies. No, I don't think NO-SQL is an alternative to SQL - it is an entirely different approach... one that should be judged on merit in each individual context.

Re:The real reason people like noSQL... (5, Insightful)

garyebickford (222422) | more than 3 years ago | (#35751050)

Actually COBOL predates SQL by about 10 years. AFAIK nobody has written a language that implements the relational query model to replace SQL. And (though I have never written anything in COBOL he says thankfully) COBOL has its place even today. I would not be surprised if there are as many lines of COBOL still running in enterprises everywhere as there are of PHP or Perl in those same enterprises.

And COBOL even now is without question a better solution for business and application programming than C ever was or ever will be. (Of course it's arguable that there are other languages better for those tasks than COBOL as well.) C is good for device drivers, kernels and as a target for interpreted and scripting languages with compiled code generators. C is, as Kernighan, Ritchie or Thompson (I forget which) said, "a structured PDP-11 Macro-assembler". Today (putting my Nomex suit on...) IMHO application programmers should not be wasting their time coping with segfaults and compile-link cycles. Their time is worth more than the machine time that any cycle-saving difference. :)

Re:The real reason people like noSQL... (3, Interesting)

Jonner (189691) | more than 3 years ago | (#35751648)

Neither SQL nor its original incarnation SEQUEL was the first language based on the relational data model. There are also more recent relational languages, such as Tutorial D [wikipedia.org] , though none has gained much popularity and few people know they exist, even in the database management world. We badly need a replacement for SQL that is more flexible and more fully implements the relational model.

IIRC, ISAM used in COBOL & before SQL (0)

Anonymous Coward | more than 3 years ago | (#35752422)

Per my subject-line above, ISAM database methods were in use before SQL, & used COBOL as an accessing language to said data (along with other programming languages as well):

"Actually COBOL predates SQL by about 10 years" - by garyebickford (222422) on Thursday April 07, @06:12PM (#35751050)

Indexed Sequential Access Method was in use with COBOL before SQL ever was...

APK

P.S.=> Just some "FYI", but I am subject-to correction too, so IF anyone knows differently, let me know... apk

Re:The real reason people like noSQL... (2)

O(+inf) (2033618) | more than 3 years ago | (#35751060)

What's wrong with the way (ANSI) JOIN works? It's practically right out of relational algebra. As an aside, the term "NoSQL" has very little to do with SQL-as-language, and really is about relational vs other. Some "NoSQL" solutions provide SQL as a query language for their datasets, and there are some relational databases out there that don't use SQL as a query language, but would not count as "NoSQL".

Joke time ! (5, Funny)

alex67500 (1609333) | more than 3 years ago | (#35751388)

An SQL statement walks into a bar. He sees 2 tables and asks "May I join you?"

Re:The real reason people like noSQL... (1)

SickLittleMonkey (135315) | more than 3 years ago | (#35751090)

Agreed. I've always called it Semi-Quasi-Language.

Re:The real reason people like noSQL... (0)

Anonymous Coward | more than 3 years ago | (#35751140)

Actually, we still program in COBOL.

Re:The real reason people like noSQL... (0)

Anonymous Coward | more than 3 years ago | (#35751158)

WTF? Insightful??? Is this slashdot or reddit?

SQL does not suck. People just don't get the whole database thing.

Start with RDBMS 101 and learn how to design your freaking tables. SQL can't do fuck if you have put everything in ONE GIGANTIC TABLE.

Re:The real reason people like noSQL... (1)

frosty_tsm (933163) | more than 3 years ago | (#35751246)

...is that SQL sucks as a language. It's not terribly expressive, the ordering of arguments is inconsistent, and whoever designed the way JOIN works should be in jail.

Frankly, I'd like to see SQL die and get replaced with something more modern. We don't program in Cobol anymore, so why the hell are we still using SQL?

You should not seek to replace something just because it is 'old' and not 'modern'. I've seen quite a bit of the modern SQL-alternatives. They have their niches but I have yet to see one that is ready to topple a well-designed relational database in performance and scalability.

Re:The real reason people like noSQL... (2)

frank_adrian314159 (469671) | more than 3 years ago | (#35751292)

The people who think that SQL sucks don't usually understand it. The first hurdle is that you need to think about it as a set-oriented language. You are dealing with operations that work on sets. You select a subset of all objects in the table, filter for only the columns that you want, modify them via update, insert new items, join two sets together, etc. If you come looking at it as a procedural replacement, you are starting out screwed.

Next, like all languages, the pure relational model has grown warts (some significant) over the years. If you're willing to consider Java or Ruby as decent languages (and there are a lot of flaws at the language level in both), you shouldn't hate on SQL for this kind of thing.

Finally, there are things that should have been in SQL that were never actually standardized - things like schema migration, for example. Yes, the language does a crappy job at them and in ways that are incompatible between implementations. But, when you look at todays object-oriented languages, which have no standardized way to migrate objects from one version to the next (well, except for CLOS-respecting Common Lisp implementations), I don't see these sorts of things as a shortcoming - languages get standardized when they get standardized.

So, yes, it's a crappy language - just like all the rest out there. But at least the language core is built on a formal model which can be followed to make databases work together better. It's longevity is not just because Microsoft or Oracle said to use it. It's because, when you get right down to it, it's a pretty reasonable language for what it was meant to do. Just like FORTRAN, COBOL, C, and many others. And it still has a better syntax than Perl. What's not to love?

Re:The real reason people like noSQL... (2)

Jonner (189691) | more than 3 years ago | (#35751736)

Just because the relational model SQL is supposed to implement is great doesn't mean we don't need a better replacement for SQL. There are alternatives, but they're so obscure, immature, or incompatible with other commonly used tools that hardly anyone ever considers them.

I use PostgreSQL at work and I'm constantly expanding what I can do with SQL, both as a result of learning and new features that are being added. However, I constantly run into its limitations and extreme ugliness. Even though I work with it every day, I still commonly look up basic syntax because it's so irregular. I'd love to be able to use a better language without giving up all the excellent properties of Postgres, but implementing that would clearly be a huge job and I'm not aware of anyone attempting that.

Re:The real reason people like noSQL... (2)

DeadDecoy (877617) | more than 3 years ago | (#35751356)

I've been working with mongo noSQL for a little while now, and it's nice because it's fast and you don't have to de-normalize data that should not have been normalized in the first place. E.g. article{ title, authors, keywords } instead of having a separate table for authors and keywords. This probably attributes to the faster speeds in those databases too. It's not so much that SQL sucks or JOINs are evil, rather that they fit a different use case very well. The argument is somewhat similar to: why should I use a flathead screwdriver on cross-head screws when a phillip's screwdriver is more effective?

I think people who get entangled into the arguments of which flavor of database is better, are often leaning towards what they're familiar with as opposed to does the tool match the problem. NoSQL is relatively new and seems complementary to SQL. If there's a framework (maybe coSQL) that combines the benefits and reduces the weaknesses of both, that seems like a welcome change.

Re:The real reason people like noSQL... (0)

Anonymous Coward | more than 3 years ago | (#35751428)

NoSQL databases are indeed faster. They're much faster when it comes to losing data. When you don't give a fuck about the ACID properties, you can do a whole lot of stupid shit much more rapidly.

Re:The real reason people like noSQL... (1)

DeadDecoy (877617) | more than 3 years ago | (#35751694)

I haven't noticed data loss yet. But that's probably because I and only a few other people are using it. Most of this use is non-concurrent and will be readonly once the initial batch of data gets in the db. Again, my argument is that this depends highly on the use case. Mine is to have some relatively fast local storage to do some large-scale statistics.
Have you ever used a noSQL database and experience data loss? Is this for all NoSQL databases or just a few? (I know mongo provides some form of logging to let you know if the query executed properly. If have run into data loss issues can you provide a concrete example (database, data, and possible race conditions) under which that situation manifests? Or are you just regurgitating counter-arguments that are floating around on the web.
At the moment, my db is stable and I haven't run into any issues. Even if the tool is not verified to be safe, I can still make effective use of it and take precautions where needed once things ramp up; hard drive space is relatively after all. Again, it all comes down to use case. I'm messing around with statistics not order entries. If a small percentage of several million entities glitches, then I can probably work around that or run multiple tests to ensure consistent output.

Re:The real reason people like noSQL... (0)

Anonymous Coward | more than 3 years ago | (#35751802)

MONGO IS WEB SCALE [xtranormal.com]

Re:The real reason people like noSQL... (1)

DeadDecoy (877617) | more than 3 years ago | (#35751876)

I saw that too, and it was funny :). But I'm not using mongo for "webscale". I'm using it to store and retrieve fuckload of data that needs to be accessed quickly for analysis. So my only other options are: cram it into RAM (not really an option), use SQL (a bit too slow for my purposes unless I have access to a cluster), or NoSQL (fast and good enough). The argument in MONGO IS WEBSCALE is don't toss out proven solutions on the problems its build for, for the trendy new technology. It didn't however, mention that mongo was unusable for the problems that it was built for.

Re:The real reason people like noSQL... (1)

whitehatnetizen (997645) | more than 3 years ago | (#35751460)

SQL is not so much a language as a standard, that is supported and extended by each database vendor. what do you mean by not terribly expressive? It is an extremely explicit way of defining and manipulating sets of data. I Use Oracle and I can say that it is an extremely powerful way of manipulating sets of data. when a statement is executed on an Oracle database, the optimiser chooses how the JOIN will work with the information it has at statement execution, whether that be a merge join or a hash join or something else, so I don't know what you mean by your first sentance. Generally people who hate on SQL are OO programmers who are unable to wrap their heads around relational database set processing. Further, saying "We don't program in Cobol anymore, so why the hell are we still using SQL?" is perhaps equivalent to saying "We don't run around bashing eachother with swords and shields anymore, why the hell are we still planting food in the ground?"

Re:The real reason people like noSQL... (0)

Anonymous Coward | more than 3 years ago | (#35751500)

I find SQL/relational databases to be much more flexible as a general data querying mechanism than NoSQL. Most data is highly relational, and SQL lets you express complex queries in a very compact syntax. There are some notable exceptions, for example hierarchical data can be a pain in SQL, but not having JOINS and ACID in NoSQL is a much bigger pain. I've worked on some Google App Engine projects, and you end up having to custom code (and test) fragile ACID logic for every damn use case, where you would simply wrap everything in a generic transaction with a SQL system. It can easily double the amount of code required. If you have a specific use case that fits the NoSQL model, all the extra work is probably worth it, but for 95% of what I deal with, it's not.

Re:The real reason people like noSQL... (3, Interesting)

Jonner (189691) | more than 3 years ago | (#35751536)

SQL definitely sucks as a language. However, the relational model it was intended to expose does not. We need languages that more fully and naturally expose the relational model.

Re:The real reason people like noSQL... (0)

Anonymous Coward | more than 3 years ago | (#35752304)

If you really think SQL sucks, then you are doing it wrong.

For a language to be 30+ years old, and require very little tweaking, and still power even the largest websites today, it says something for the robustness of the SQL designers 30 years ago.

I personally started doing as much as I can in SQL, when it comes to data transformation and manipulation.

You get the right set of tools, and UDFs, SPs and SQL itself is extremely powerful for a 30 year old language.

Re:The real reason people like noSQL... (1)

godglike (643670) | more than 3 years ago | (#35751578)

SQL is the most successful language in Computer Science history and the only one that has a proper mathematical basis.

Other languages have the odd mathy type thing like lambda calculus but SQL is set theory.

It's not perfect (ANSI JOIN sux, crosstabs would be great) but it's way more powerful and expressive than anything else.

If you don't get it, do some research and find out about more than SELECT, CREATE, and INSERT.

Re:The real reason people like noSQL... (1)

sapgau (413511) | more than 3 years ago | (#35751724)

Will a noSQL offer the same SQL properties of transactional databases, with referential integrity, transactions, joins, etc.?

If so, then it sounds like people just want to change the syntax of how to express sql statements. This will end up into having two query languages which should do the same thing.

Re:The real reason people like noSQL... (0)

Anonymous Coward | more than 3 years ago | (#35752286)

Frankly, I'd like to see SQL die and get replaced with something more modern. We don't program in Cobol anymore, so why the hell are we still using SQL?

I'm working on a relational alternative [github.com] , as are others. But anyone trying to devise a SQL killer is 30 years late to the party. There's no way you'd be able to match the feature set of modern SQL DBMSs.

Even if you target people who aren't terribly interested in features, there are two big problems. One is convincing people to move from SQL to something else. In every aspect of the language, SQL is "good enough." The worst part is ostensibly the syntax, and I can't help but notice that no one tries to write C or Java without extensive support from their IDE. All you need to bang out SQL is auto-indent.

The second, and arguably bigger problem, is that people think that because they can write some SQL that they understand databases and understand the relational model. So a good portion of my work has been trying to explain relational theory while I'm explaining the language I'm developing. The math itself is dead easy, but for whatever reason, a lot of people just don't seem to get data.

Re:The real reason people like noSQL... (1)

codepunk (167897) | more than 3 years ago | (#35752450)

Actually I have no problem with the SQL language. I work in a heavy NoSql environment. We do not hate sql engines it is just that none of them are fast enough to deal with the transaction rates we require.

Re:The real reason people like noSQL... (1)

clockwise_music (594832) | more than 3 years ago | (#35752506)

Insightful? People like noSQL because it allows them to have messy unstructured data and not do any data modelling.

We're still using SQL 20 years later because it's a great layer between your OO code and your relational data. Unless you want to use a heirachical database (which no-one does) SQL works fine. Sure you can use an ORM but at some stage you'll need to handle the conversion between relational and OO.. unless you're happy being ignorant as to how your database works and not be able to performance tune anything.

nothing new in computer engineering since 1980 (2, Funny)

Hazel Bergeron (2015538) | more than 3 years ago | (#35751014)

Nothing new in computer engineering since 1980. Prove me wrong.

Re:nothing new in computer engineering since 1980 (-1, Offtopic)

badboy_tw2002 (524611) | more than 3 years ago | (#35751038)

Chip features were smaller than 45nm in 1980? Cool!

Re:nothing new in computer engineering since 1980 (1)

ArsonSmith (13997) | more than 3 years ago | (#35751132)

let's see. 1980 had both 1's and 0's. today we have just 1's and 0's. Even before 1980 someone invented -1's 0's and 1's, but it never really took off.

So...

nope, nothing new in computer engineering.

Re:nothing new in computer engineering since 1980 (0)

Anonymous Coward | more than 3 years ago | (#35751196)

Shor's algorithm.

Re:nothing new in computer engineering since 1980 (0)

Anonymous Coward | more than 3 years ago | (#35751204)

What happened in 1980?

Re:nothing new in computer engineering since 1980 (1)

DogDude (805747) | more than 3 years ago | (#35751232)

If it ain't broke...

And SQL isn't broke... there are just lots of people too lazy to learn not only the language, but to learn the fundamentals of how a relational database works.

Re:nothing new in computer engineering since 1980 (0)

Anonymous Coward | more than 3 years ago | (#35751590)

OpenGL

Re:nothing new in computer engineering since 1980 (1)

lennier (44736) | more than 3 years ago | (#35752122)

Come on, didn't the Sinclair QL [wikipedia.org] single-handedly revolutionise computing? Aren't we all using stringy floppies [wikipedia.org] today, as we whizz on our C5s [wikipedia.org] to the Ministry of Space [wikipedia.org] ?

In your heart, you know it to be true.

not surprising (0)

Anonymous Coward | more than 3 years ago | (#35751052)

Think about it, SQL is proven to be sufficient to store any relationships between data (though it may be ugly). SQL can be captured onto a spinning disk by using one of those fancy DB engines. noSQL get's rid fo the fancy DB engine, so why is it surprising that SQL and noSQL can be shown to be equivalent? And coSQL then amounts to adding an interface layer that can be translated down to either representation. Jeeesh -- what passes for interesting these days!

Re:not surprising (5, Insightful)

MightyMartian (840721) | more than 3 years ago | (#35751164)

To my mind, SQL's biggest problem over the years has been really shitty implementations (and yeah, I'm looking at you, MySQL).

NoSQL? A better name... (0)

Anonymous Coward | more than 3 years ago | (#35751114)

would be NoConsistency. Oh wait, they have eventual consistency... pretty good for twitter where no one cares to get stuck in a partition missing that gorgeous (fake) blond posting that she's cleaning her teeth.

Both can be combined (0)

Anonymous Coward | more than 3 years ago | (#35751146)

Greenplum supports both SQL and MapReduce (NoSQL) native.

Dual ... monadic ... uhuh ... (1)

SickLittleMonkey (135315) | more than 3 years ago | (#35751234)

"Relational SQL and key-value NoSQL models are mathematically dual, and provides a monadic query language for what they have coined coSQL."

I'm glad somebody clarified that! (Time to RTFA.)

Re:Dual ... monadic ... uhuh ... (1)

JonySuede (1908576) | more than 3 years ago | (#35751538)

What this all means is that coSQL and SQL are not in conflict, like good and evil. Instead they are two opposites that coexist in harmony and can transmute into each other like yin and yang. Because of the common query language based on monads, both can be implemented using the same principles.

here, you should have skipped to the conclusion.

Re:Dual ... monadic ... uhuh ... (1)

Sarten-X (1102295) | more than 3 years ago | (#35751674)

They're wandering doppelgängers... that's obvious, right?

NoSql (1)

codepunk (167897) | more than 3 years ago | (#35751562)

If I am running a NoSql solution it is because I need every bit of speed I can muster. Putting a additional layer on top of that does nothing to reach that goal.

Re:NoSql (1)

Jonner (189691) | more than 3 years ago | (#35751778)

You're not getting every bit of speed you can muster unless you're in control of what's happening at every level, down to every CPU register, byte in RAM, on a disk (not file), and every cache in between. That approach used to be common when chips were slow and expensive, but not any more because it's just not worth the effort. If you're using a "NoSql solution," you are not in control of every byte at every level.

Column Based Storage (1)

PhrstBrn (751463) | more than 3 years ago | (#35751602)

I thought the whole reason why NoSQL is "better" than SQL is it's based on column based storage, while most SQL databased are row based storage. Couldn't you make a column-based database that uses SQL as a query language? There is nothing wrong with SQL as a language, there are just some workloads where column based storage is faster (mostly data analytics).

Re:Column Based Storage (1)

Haxamanish (1564673) | more than 3 years ago | (#35752074)

Couldn't you make a column-based database that uses SQL as a query language?

Sybase IQ [wikipedia.org] is column based and uses SQL [sybase.com] .

Re:Column Based Storage (1)

Estanislao Martnez (203477) | more than 3 years ago | (#35752364)

I thought the whole reason why NoSQL is "better" than SQL is it's based on column based storage, while most SQL databased are row based storage. Couldn't you make a column-based database that uses SQL as a query language? There is nothing wrong with SQL as a language, there are just some workloads where column based storage is faster (mostly data analytics).

There are a number of column-oriented SQL databases. Another commenter pointed out Sybase IQ; I'll point out Vertica [vertica.com] , and leave you to Google others if you want.

Relational Databases are great, not SQL itself (2)

bigsexyjoe (581721) | more than 3 years ago | (#35751878)

My I'm just being a nit-picky coder here, but I don't get why they call it noSQL, when they are really referring moving away from relational databases?

When I first heard of "NoSQL", I thought, "Great! SQL is a terrible syntax with all it's six letter words and easy dangerous mistakes. I would love to have a superior syntax for interacting with the relational databases that are central to my work!" But "NoSQL" should be called "NoRelational." It is kind of strange that you are changing the whole paradigm of the database around and you are describing it as changing a superficial feature. It would be like calling emails "no pen" writing.

Nonsense Dressed up in math (0)

Anonymous Coward | more than 3 years ago | (#35752158)

SQL and noSQL have so little in common other than the letters S Q and L that their paper is just nonsense.

Dressing in math doesn't make nonsense anymore respectable than otherwise -- funny? as in the following? probably.

I read this so long ago in print, I thought I may not find it on the web, but here it is. Enjoy gobbledygook shrouded in math (the first of the many URLs I found).

http://komplexify.com/epsilon/2009/02/06/imperturbability-of-elevator-operators/

MS Research could mainly be a tax shelter and may do as a side effect some god stuff, ocassionally.

I'm skeptical (1)

Estanislao Martnez (203477) | more than 3 years ago | (#35752184)

That's a very interesting article, and I'm going to have to look up the research and read it a lot more carefully. But I'm worried that a lot of their analysis just assumes too strongly that relational model = SQL.

For example, their claim that SQL is "not compositional." They define "compositionality" like this:

What we observe here is SQL's lack of compositionality—the ability arbitrarily to combine complex values from simpler values without falling outside the system.

Leaving aside that "compositional" [wikipedia.org] is an odd word to use for this, the first problem here is that the relational model is in fact agnostic about this so-called "compositionality" of column's value's types. The relational model, strictly speaking, doesn't forbid you from having composite-typed columns.

Some, some proposed purely relational solutions to the problems tackled by outer joins is to allow non-base columns to have relations (i.e., sets) as their values. To put it in more SQL-like terms, you could have queries whose result sets had columns whose value was also a multi-row result set. This sort of thing solves the Figure 4 problem from TFA—you would have one row in the result, with Title="The Right Stuff" and Keywords={"Book", "Hardcover", "American"} (a set-valued Keywords column in the result). We can even sketch a SQL-like query for this (not actually valid SQL):

SELECT p.title AS Title, (SELECT k.keyword FROM keywords k WHERE k.productId = p.ID) AS Keywords
FROM products p
WHERE p.rating = '****'

Or this, with a fictional "SET" aggregate function: (again, not actually valid SQL):

SELECT p.title AS Title, SET(k.keyword) AS Keywords
FROM products p INNER JOIN keywords k on p.ID = k.productId
WHERE p.rating = '****'

Load More Comments
Slashdot Login

Need an Account?

Forgot your password?

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>