3 ms·
These arguments make me feel like DBMS technology is insufficiently distinguishable from magic. Databases do two things: they persist data, and they answer que
by derefr 16y ago
These arguments make me feel like DBMS technology is insufficiently distinguishable from magic.
Databases do two things: they persist data, and they answer queries about data. Neither of those requirements put any restrictions on how they serialize data. Relational storage, object storage, document-based storage, key-value storage, graph-based storage, etc.—it all just seems like different optimizations on the same "real" data, something that should be abstracted away from the database administrator entirely.
Why can't we just have a database that gets fed a normalized, relational-algebra-style model of the data, but then profiles the kinds of queries fed to it, and the kinds of data given, and builds whatever kind of denormalized tables/indexes/k-v stores are optimal for your usage patterns, using a Relational, or Object DB, or Graph DB, etc. engine when each is appropriate (perhaps firing them off in parallel and returning whichever answer comes first, killing the other threads)? Is this something anyone is working on?
- seldo 16y agoIf you can build this, please, please let me buy it. Or preferably invest in it.
- randallsquared 16y agoThis sounds suspiciously like a sufficiently smart compiler.
- derefr 16y agoI was mostly thinking of the profile-driven optimization of the HotSpot JVM—something that was repeatedly called a Sufficiently Smart Compiler, until it happened to actually work.
- panic 16y agoApple's Core Foundation data structures do this sort of "usage-based implementation selection," though in a much simpler context: (see e.g. http://ridiculousfish.com/blog/archives/2005/12/23/array/ http://ridiculousfish.com/blog/archives/2005/12/23/array/). I'm not sure why this technique isn't more widespread.
- deleted 16y ago[deleted]
- silentbicycle 16y agoA "query optimizer", let's call it. That'd be so cool. I wish RDBMSs came with query optimizers. Maybe something that could ANALYZE (or, better yet, EXPLAIN) their performance, so people could tune it. And yeah, sarcasm aside, it's easier to have a DBA tune things than some AI - of course: "Why can't we just have a compiler that gets fed a description of the problem, then solves it, calculating the optimal solutions for all of the engineering trade-offs, and then builds whatever kind of interfaces are optimal for your users choosing Design Patterns as appropriate. Is this something anyone is working on?"
- derefr 16y agoYes, RDBMSes already have the capability to tell you how to best optimize them. The problem—and it's a sociological problem, not a technological problem—is that people don't want to tune their databases. Instead, they want to install something that is already tuned 80% correctly (i.e. a NoSQL store), and then ignore the other 20% of possible optimization. There's a big, unaddressed opportunity here: if you can just make your DB smart enough to tune itself 81% correctly (and that's not very hard—certainly not AI hard) then you can conquer the market for people who don't know how to EXPLAIN their way out of a paper bag. It's not like it would be inventing its schema on the fly; you'd still be feeding it a formal, completely-specified but unoptimized set of tables. It would just do things like: * Notice when it gets a query with the same parameters 10000x in a row, and grind out an index for it; * Notice when a large (>100000) set of rows in a table is identical save for their primary key, and only queried by COUNT(foo), and turn those rows into a single row with a foo_count field (and a log table in case a query ever does come in that cares about the IDs); * Notice when two tables are only ever queried joined together, and morph the primary store for them into a denormalized table, turning the previous, separate tables into views on the denormalized table. And so on. If you look at, say, Python's hashtable library, it has all sorts of these little "rules of thumb" for when to alter its internal representation, because of what it guesses the user is up to (storing unique pairs, creating mathematical sets, nesting hashes to mimic a complex data structure, etc.) Databases, on the other hand, much bigger systems purely for flexibly storing and querying data, just stubbornly sit there until the DBA (because there must always be a DBA, even if the DB is just being fed migrations written by Rails CRUD coders) comes along to tell them to do the things they already know would make them faster. It's just silly.
- gfodor 16y agoThis is what is going to need to happen. I think now that people really understand how to build distributed data stores like HBase and Cassandra you'll see those be the "storage engines" behind such a system. The abstractions need to stop leaking into the query language and modelling tools. We'll get there I think.