by jsilence · 7y ago · 0 comments
Sorry for being sarcastic, but was that not exactly the point of countless database abstraction layer projects?
To really get there, you actually need a object db, like zoodb[z] for python (which incidentally can use pg as a storage back-end).
If you're using a db abstraction layer, and a typical active record like surrogate keys - then for simple use cases you can indeed switch back-ends; many rails projects run tests on sqlite and production on postgresql.
That's not a great idea, but it works for simple projects (first gotcha; most rdbms don't have a global namspace for indexes; sqlite does).
But there's no standard AFAIK for full text indexes, geodata, json/bson, materialized views... So it depends a lot on how much of the db you're actually using.
[z] http://www.zodb.org/en/latest/tutorial.html
Note that an object db does not free you from thinking about data structure migrations:
http://www.zodb.org/en/latest/guide/writing-persistent-objec...
Doing mapping of db result sets to object is non trivial, no need to do develop it multiple times for each RDMBS when 90% of the code would overlap.
I'd work on the sarcastic attitude though
The abstraction is useful. The abstraction is leaky.