3 ms·
I don't understand how this is giving any advantages over the standard object interface. How is: > r.table('tv_shows').insert([{ name: 'Star Trek TNG', episod
by ebbv 14y ago
I don't understand how this is giving any advantages over the standard object interface.
How is:
> r.table('tv_shows').insert([{ name: 'Star Trek TNG', episodes: 178 }, { name: 'Battlestar Galactica', episodes: 75 }]).run()
Easier than:
> db['tv_shows'].push([{ name: 'Star Trek TNG', episodes: 178 }, { name: 'Battlestar Galactica', episodes: 75 }]);
Seems to me like a totally unnecessary abstraction which only adds complication and potential points of failure and bugs.
EDIT:
Ok never mind this does actually create a real database. From the demo it seemed like it was just creating a JSON object.
- coffeemug 14y agoIn the former case you're creating a query (similar to SQL insert) that puts data into the database. You can then take advantage of indexing, sharding, durability guarantees, caching, a specialized query language, and all the other benefits of a database system. In the latter case you're creating a data structure in the host language (which of course is immensely useful, but completely different).
- ebbv 14y agoMy mistake, from the demo I thought this was just creating a JSON object, and there was no actual backend database.
- coffeemug 14y agoRight. The demo implements the backend database in Javascript, so you can run real queries against it. (Still, the whole thing is confusing and I'll make it much, much better) slava @ rethink -- I was responsible for the tutorial
- alexpopescu 14y agoThe main difference is what happens if you chain together multiple operations. Are these executed one by one (each resulting in a roundtrip to the database) or executed all at once (single roundtrip to the db). As a side note, each programming language has its own idioms. We tried to bring the ReQL query to each language in a way that felt as close as possible to the host PL (as opposed to say SQL which you need to use it as it is; and that led to the hundreds or thousands of wrapper libraries/ORMs. etc). alex @ rethinkdb