Preface: I'm a PHP developer who sticks to MVC. I've spent the last two years writing a search engine that uses Oracle, MySQL, MongoDB, LDAP, (and soon, probably, CouchDB). I'm not some idiot who sticks database connection code into their view.

Originally Posted by
uid313
Please not another query language.
Does every database need its own query language?
To give a counterexample: As Mongo shows, no. There is no "query language", it uses a purely programmatic interface which greatly simplifies your business logic / model layers. That being said, there are significant differences between traditional rowstore databases such as Oracle/MySQL and columnstores like Cassandra. SQL doesn't make a hell of alot of sense unless you force users into a rowstore-like convention. Great example of that: InfiniDB. Columnstore, but with a MySQL interface. Ass-kicking performance, too.

Originally Posted by
uid313
If you switch or migrate to another database solution then you have to rewrite your database queries. It leads to vendor lock-in.
False... if you're locked into one database because of the query language, you're doing it wrong. Your database code should be abstracted from your models using ORM or another common API layer. To support additional database engines, write ORM layers for them. Done.

Originally Posted by
uid313
Can't we all get along and use à standard common query language?
Again, Cassandra is a columnstore database, so SQL doesn't make a hell of alot of sense for what the product does. Mongo, being a recordstore (with no strict "schema"), also shouldn't have to fit into an arbitrary query "language" either... they're nonsensical.
Query languages in general are the problem, we need more purely programmatic interfaces to databases. I'd say one of the biggest drawbacks of MySQL/Oracle is that they rely on the developer to pass them STRINGS of data hacked together with escaping functions, rather than something that makes sense to a developer.
PHP Code:
<?php
// MySQL Database Connection
$dbh = new mysqli('localhost', 'my_user', 'my_password', 'userdatabase');
if($result = $dbh->query('SELECT * FROM users WHERE FIRSTNAME = '.$dbh->real_escape_string($name))){
// Cycle through results
while ($row = $result->fetch_object()){
$user_arr[] = $row;
}
// Free result set
$result->close();
}
// Mongo Connection
$m = new Mongo();
// Use the user database
$db = $m->userdatabase;
$user_arr = $db->users->find(array('FIRSTNAME' => $name));
?>
One of the most basic advantages here is that I can specify 'FIRSTNAME' as a variable in the Mongo Connection case. To do that with MySQL, I either have to write complex query language building logic, or I have to write lots of specific use case queries with placeholder variables to handle each scenario.
Query languages are the bane of a developer's existence. There's a reason why Hibernate (Java) and Active Record (Ruby) are so popular... For PHP, I recommend replacing MySQL as your database swiss-army-knife with Mongo. It is faster in every regard and "the Oracle" isn't looming over your head.