2 ms·
"I can do that with hash arrays. The primary key is my primary hash, other keys are just extra hash maps pointing to the main array." A.k.a an in-memory table
by nostrademons 19y ago
"I can do that with hash arrays. The primary key is my primary hash, other keys are just extra hash maps pointing to the main array."
A.k.a an in-memory table with hash indexes. MySQL has them. ;-)
You're still missing out on a lot of functionality (even besides transactions/persistence/concurrency). For example, what if you want all records where the creation date is between a certain range of days? Or how about the maximum value of a certain column? How about joins?
A conventional database can retrieve these from the indexes, but your multiple-hashes system would require a full table scan.
- mojuba 19y agoAll you just said is map/reduce, possibly optimized for large data chunks internally. In fact if we create a proper infrastructure, "indexing" can be done automatically and transparently. And I never said arrays should be in memory entirely, even though I declare them as arrays in my language.
- brlewis 19y agoSQL indexes work transparently. Creating them automatically would not be good, since they have a cost for write operations.