Archive for September, 2010

Why Relational Databases, Anyway?

Wednesday, September 22nd, 2010
news and informationbusiness,health,entertainment,technology automotive,business,crime,health,life,politics,science,technology,travel

Calling a data store “NoSQL” is not quite right. Insofar as they mean “no SQL can be found here”, what they are really saying is that it’s not a relational database. (More properly, a relational database management system.) SQL, per se, isn’t the only relational query language there ever was. It’s just the one that caught on and “got traction”.

For example, one of the early relational DBMS’s was called Ingres, done by a team at U.C. Berkeley lead by Michael Stonebraker. It had a query language called QUEL, which was a competitor of SQL (then called SEQUEL). That could have been the query language used for relational database systems today.

If memory serves, QUEL was cleaner than SQL. QUEL was more directly modeled on the relational calculus, whereas SQL is sort of a hybrid of the relational algebra and the relational calculus, which is quite different in structure. This is not exactly my area of expertise, so I’ll stop here, but the point is that the data modes of “NoSQL” systems are really no relational model database systems.

There’s a famous saying: “fish are not aware of water”. A whole generation of software engineers swam in the water of relational database systems, having seen nothing else, with no basis for comparison. To say “database system” meant “relational database system”.

They were so widely accepted that anything else was viewed with suspicion if not outright contempt. Back at Object Design, we made an object-oriented database system called ObjectStore We took a lot of criticism in news groups and such from relational model fans, but they often expressed themselves poorly, e.g. “well, everybody knows that relational is good and anything else is bad”. It’s rather hard to answer the criticism in that form. What was really going on here?

As with most things in the software world, the relational model is a particular tool to solve a particular problem. The relational model solved a problem that was very important in its time, and is still important now in some contexts. The problem is to create a clean layering between applications and database systems, which is called “Data Independence.” More about this in a future post.

Reactions to the Proposed Burning of the Koran

Friday, September 10th, 2010
news and informationbusiness,health,entertainment,technology automotive,business,crime,health,life,politics,science,technology,travel

Even though Terry Jones has rescinded his threat to burn copies of the Koran, I think it’s very interesting to take a look at who reacted in what way.  There’s very extensive coverage from CNN, but here’s a summary:

Reactions from non-Islamic entities and people

Israeli Prime Minister Benjamin Netanyahu said the burning of the Quran is wrong and undermines religious tolerance and peace. “The prime minister urges that such irresponsible actions not be taken,” read a statement from his office.  Excellent.

Republican Senate Minority Leader Mitch McConnell’s comments were about the “military danger in Afghanistan”.  It’s pretty clear what this is about: He does not want anyone to accuse him of being “soft on terrorism”.  And now I understand why Obama’s statement yesterday “played the military card”: it provided a way for Republicans to get on board.  Clever!  Same deal with Senator John McCain.

Kudos also for Republican Florida Governor Charlie Crist, United Nations Secretary-General Ban Ki-moon.

Reactions from Islamic entities and people

I’ll put the bad news first; it gets better after this one.  A spokesman for the Taliban in Afghanistan told CNN, “If in Florida they were to burn the Quran, we will target any Christians, even if they are innocent, because the Quran is our holy book and we do not want someone to burn our holy book.”  Now, that’s utterly awful.  Not surprising, but more than reprehensible.

Hamas has called on God to punish anyone who burns the Koran.  That’s fine with me.  He also called Jones a ‘retard that expresses a Western-retarded mentality’ that targets the Quran, Islam, and Muslims.  Here he is blaming all Westerners, which is clearly (see above) unfair.  He leads an organization that takes that point of view, so I’m not surprised that he should say that, but it’s too bad.

(At first I thought it was funny that he should use the pejorative “retard”, which I usually hear from children.  But then I realized it’s possible that is a translation an Arabic word, and the connotations of the word are probably different. It’s also possible that he said it in English without realizing that it sounds childish. It would be wrong for me to jump to conclusions about issues of both languages and culture of which I know little.)

But now it improves:

There were some sporadic protests in Afghanistan, e.g. near NATO outposts.  There have been a few people hurt, and, sadly, one death.  But my impression from what I’m hearing is that these were peaceful protest, which I consider entirely appropriate; that’s what I would do if an equivalently despicable action was threatened against me.

Indonesian President Susilo Bambang Yudhoyono called on America to urge the government and people to stop this, and for America to live up to its own standards.  Great; I could not ask for more, under the circumstances.  Remember that Indonesia has more Islamic people than any other state, if I’m not mistaken.

Iranian Shiite cleric, Grand Ayatollah Lotfollah Safi Golpayegani, did not call for violent action.  He wants Jones arrested, and would hold Obama and the US government responsible.  I’m not surprised that he doesn’t realize (or doesn’t respect) the concept of the First Amendment prohibition.  As I understand it, what we call “the separation of church and state” is inconceivable to people like him.  Jones might have gotten arrested, for violating the fire department’s order, but not for speech.  As for his second comments, it’s interesting that he condemned the US government, but not the US population.  Was this carefully on purpose?  I don’t know.

Sajjad Karim, a Muslim and member of the European Parliament for Britain, told the chamber Thursday that the Quran burning “is the act of one man and his followers alone. His actions should not be identified with the West or Christianity.  Yay!

Reactions

I think there is actually a bit of a silver lining to this horrible storm. The USA, and much of the Western world, demonstrated that they hate the idea of burning of the Quran. It happened fast. It happened across the aisle (I mean, when was the last time you heard Obama and Palin agreeing about something?) Having Prime Minister Netanyahu on board is heartening as well. People all over the world rapidly and strongly denounced Jones’s proposal, and forced him to stop. This is a fine hour for religious tolerance. I hope the Muslim world appreciates these reactions and what they mean.

Does anyone know about Al-Jazeera’s broadcasts in the Arab nations? From what (little) I’ve heard about Al-Jazeera, they will report the truth, but what emphasis they put on what is important. And I don’t think they necessary report the same exact things in different parts of the world.

Rev. Terry Jones Marks 9/11

foobar 12

The Horror of Burning the Koran

Thursday, September 9th, 2010
news and informationbusiness,health,entertainment,technology automotive,business,crime,health,life,politics,science,technology,travel

I didn’t originally intend to have a lot of political articles in this blog, but some amazing things have been happening that I feel I must discuss.

President Obama, who sometimes seems to be rather quiet and not using the “bully pulpit”, has come out very strongly against the action, in more than one appearance today.

He has played the military card as well as “…what he’s proposing to do is completely contrary to our values as Americans.

He was joined by Gen. Petreus and the F.B.I. So do Sarah Palin and Glenn Beck (and Republican leader Haley Barbour, but he followed it with a completely stupid attack on Obama).

In fact, the Times says “Mr. Obama is the strongest voice so far among a long list of prominent political and religious leader…” Strongest voice! Good for him!

On top of all this, Jones has been denied a permit from the fire department.

To add a touch of comic relief to all this, there is a story on the Fox News web site, reporting on all the objections, including the following: “State Department Calls Plan to Burn Korans ‘Un-American’”

…State Department spokesman P.J. Crowley called the plan “inflammatory” at a briefing Tuesday and…

Jones justifies the burning according to the following verse from the Bible:

Acts 19:19 Many of them also which used curious arts brought their
books together, and burned them before all men: and they counted the
price of them, and found it fifty thousand pieces of silver.

In an interview on ABC, he is asked “But there are a billion and a half Muslims in the world. Most of whom aren’t radical and you are going to burn their holy book.” and he (amazingly) says “Right”. He also says “In fact to a certain extent we would expect moderate Moslems to agree with us.” I don’t know what planet he’s coming from. Most of the iterview is hard to read, making Sarah Palin sound like a pinnacle of rhetoric.

This one is interesting: “The website of the church that plans to burn a Koran on Saturday [doveworld.org] to commemorate 9/11 was removed from the internet after its hosting service [namely, Rackspace] said the site violated its terms of service agreement.”

Dan Goodgame, a Rackspace spokesman, said in a telephone interview that the company reserved the right to stop hosting Jones’s hate speech” as of Thursday morning. He said Rackspace was protecting its right not to associate and do business with Jones under the company’s terms of service contract.

Unsurprisingly, Jones said Rackspace’s move Thursday was an “indirect attack on our freedom of speech”. I’m not a lawyer. I always thought that the First Amendment only talks about what laws can be made by legislators (“Congress shall make no laws”, and also the states under the principle of “incorporation). One can make a case that allowing him to “speak” is part of our value system. But does “speak” mean he gets to use Rackspace? What if he wants to write a story (not an ad) in the New York Times? I defer to others on this.

Oh, 25 minutes ago, while I’ve been pulling all this together, Jones canceled the whole thing “because the leader of a planned Islamic Center near ground zero has agreed to move its controversial location.” That’s entirely inconsistent with everything he’s said, but I guess he needs to save face. Fox News opinion also suggested this plan.

NoSQL Storage Systems Never Violate ACID. Never? Well, Hardly Ever!

Tuesday, September 7th, 2010
news and informationbusiness,health,entertainment,technology automotive,business,crime,health,life,politics,science,technology,travel

Everybody agrees that the new “NoSQL” storage systems “aren’t ACID”, or “don’t have transactions”.  This is true <i>in a sense</i>, but without knowing the sense, it doesn’t tell you much.

In one sense, they <i>do</i> have transactions that are limited to having one operation per transaction.  One operation could mean reading, writing, incrementing, or doubling the value associated with a particular key.  For example, look at an “insert” operation in a key/value store.  An operations acts on only one data object.  Are these single-operation transactions ACID?  Let’s check each criterion:

A means “atomic”: either all the operations happen, or none of them happens.  Well, there’s only one operation.  The key-value store <i>does</i> guarantee that either the insert happens, or it doesn’t.  So the transaction atomic.

C means “consistent”.  In relational database systems, people use this to mean that various interesting consistency guarantees are maintained.  But here, we don’t have to worry about such things as referential integrity, since there are no references to have integrity; that is, there are no foreign keys.  So it’s consistent.

I means “isolated”: concurrency is never seen by the application.  The system behaves as if each operation happened at a particular, distinct moment in time.  The key-value stores all make this guarantee.

D means “durable”: before the application is told that the transaction has been completed successfully (i.e. committed), any side-effects it does are in stable storage so that if a node stops (such as a crash of a process or a whole node) won’t lose the results of the side-effects.  Here, a transaction is only one operation, but that doesn’t change anything: the system does provide “durability”.  (Some systems might cheat by not actually forcing data to stable storage, but we’re not talking about those.)

So it appears to be ACID!  OK, something has <i>got</i> to be wrong here, right?

Right.  Where I tried to pull the wool over your eyes is the definition of “C”.  “C” doesn’t just mean conforming to the databases integrity constraints.  It means that the system returns the correct answer! That is, response to any operation is consistent with some state that the database could be in.  There’s more than one such state when there are concurrent operations going on, which might be ordered in more than one way, depending on how the concurrency system works.  So it’s clearer to think of “C” as meaning “correct”.  (In the famous Gilbert and Lynch paper that “proves the CAP theorem”, that’s what they mean by “C”.)

The “NoSQL” storage systems are guaranteed return the correct answer <i>only</i>if there are no partitions in the network.  But if there are (or were, e.g. at write time) partitions, they can return things like “two replicas say the value is X, but another replica says that the answer is Y”, and the application has to try to make sense of and cope with that.  That is <i>not</i> “C”.  This is usually called “eventually consistency”: if the partitions were to eventually heal and the system deferred accepting new operations until all the in-progress operations finished, and something went over the whole database to fix up any inconsistencies that happened during writes, then the system would become fully consistent, and would be behave correctly until the next partition.

that there are at least two nodes that cannot send messages between each other.  It’s important to know that if a node in your your system is down, that’s considered a partition: it’s as if this node were disconnected from the network.

The “NoSQL” systems are ACID, as long as you accept that a transaction can only perform one operation, in the sense that the only thing that gets in the way of being ACID is when there are network partitions and the system is called upon to perform operations while the partition is still there.

“Partition” is a somewhat slippery concept that I will examine in an upcoming separate essay.  But the basic ides is that a it means that there are at least two nodes that cannot send messages between them.  It’s important to know that if a node in your your system is down, that’s considered a partition: it’s as if this node were disconnected from the network.

This also shows that the name “NoSQL” doesn’t explain everything that’s important about these systems.  But you can’t pack a whole lot into a short, punchy name, so I’m not really complaining.  ( do the same thing with the names of my blog essays; <i>mea culpa<i>.  You just have to keep in mind that the lack of SQL is not the only important thing.