25 ms·
Unfortunately, while drupal ostensibly supports other database backends, the reality is that it doesn't support other database backends.
by mjgoins 17y ago
Unfortunately, while drupal ostensibly supports other database backends, the reality is that it doesn't support other database backends.
- CitizenKane 17y agoThis is something that is being rectified with the upcoming Drupal 7. This is a rather tough nut to crack because different database servers don't actually have compatible SQL syntax even among some basic queries. A lot has been done to improve this, including an API to declare database tables in a way which is SQL server neutral. And Drupal 7 will also have query builders to deal with differences in syntax among some of the more basic queries.
- gaius 17y agoIt's not even a matter of SQL syntax. Oracle, for example, uses cursors implicitly and declaring a cursor just gives you a handle to it. In SQL Server, using a cursor is an expensive operation. So if you are trying to be database-neutral, do you use cursors or not? How does that affect the likelihood of deadlocking? Etc etc etc. In practice if you try to be database agnostic you end up with something like SAP which runs like molasses in Winter equally on all databases...
- jrockway 17y agoThe problem is not enough abstraction. If your application code sees things like cursors or SQL statements, your design is broken.
- gaius 17y agoI'm talking about inside Drupal itself. Locking strategy is another one: it's impossible to optimize for one database without sucking on another. Lots of developers with experience only on one don't even know they're doing it, they think this is just how databases work. Being database agnostic makes as much sense as trying to write code that compiles in both C and Java.
- jrockway 17y agoBeing database agnostic makes as much sense as trying to write code that compiles in both C and Java. Maybe if you are writing the realtime transaction processing system for Visa... but this is a CMS. Flexibility is more important than absolute speed. 99% of page views are going to be served from the cache.
- aasarava 17y agoThe percentage of page views served from cache depends on the type of site you're building. Newspaper site? Sure, cache it all. Social network? It's going to be tough to manage a cache when the content is constantly changing and is viewed differently by each user.
- brandnewlow 17y agoThis all sounds like a nightmare for the casual/less-proficient developer to figure out. Is this a problem that a majority of Drupal developers face?