Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

To-do/Feature Request list? #17

Closed
timboisvert opened this issue Oct 1, 2013 · 7 comments
Closed

To-do/Feature Request list? #17

timboisvert opened this issue Oct 1, 2013 · 7 comments

Comments

@timboisvert
Copy link

Do you have a list of features you'd like to see implemented?

@nviennot
Copy link
Collaborator

nviennot commented Oct 3, 2013

I'd like to support the Mongoid API so that people using MongoDB can switch to RethinkDB without too much hassle.

I don't want to support embedded documents though, I believe they introduce too much complexity and eventually make the abstraction leak.
As a comparison, NoBrainer is currently at 760 lines of code, Mongoid is 14,000 LOC and ActiveRecord is 16,200 LOC. I would like to keep everything as simple as possible on the long term.

@ajselvig
Copy link
Contributor

ajselvig commented Oct 4, 2013

Can you explain a little more about the problems you see with embedded documents? I've been using MongoDB/Mongoid for a while and have found embedded documents quite handy. When looking at the feature list for NoBrainer, that was the first thing that stood out.

On a separate note, I'd love to see something like Mongoid::Timestamps.

@nviennot
Copy link
Collaborator

nviennot commented Oct 4, 2013

  1. Embedded documents are often misused: embeds_many is deadly when the list of embedded documents grows too large.
  2. Callbacks behavior is hard to define properly.It's sometimes hard to predict what will really happen with Mongoid.
  3. Doing database queries on embedded documents gets funny very quickly.
  4. Embedded documents are useful because of the lack of DB transaction, but it's really hard to give very good semantics when doing complex queries (for example decrementing a field, and deleting an embedded document at the same time).

Yes for Mongoid::Timestamps. I'm almost tempted to have them enabled by default (something that you opt out as opposed to opt in). Usually, there is very little overhead in having timestamps, and you'll be happy to have them if you want to audit something.

@ajselvig
Copy link
Contributor

ajselvig commented Oct 4, 2013

I definitely agree on the timestamps. Making them default seems reasonable because they're so useful and have little overhead.

I can't disagree with any of your specific reservations about embedded documents. They definitely do present some challenges. However, there are situations where they can be very useful and also improve performance (be able to retrieve a single document instead of having to do one or more joins). Also, it is a feature present in RethinkDB, so omitting it from (seemingly the only) Ruby ORM seems like leaving a big hole for users. Just my two cents, though.

@nviennot
Copy link
Collaborator

nviennot commented Oct 4, 2013

You can always store an array of hashes, or hashes in a field. You would essentially be managing your own embedded docs.
I'd be happy to provide embedded docs support, if we can find some proper semantics around them that never surprise you.

@ajselvig
Copy link
Contributor

ajselvig commented Oct 5, 2013

Yeah, I guess I don't have any specific suggestions on that front. Being able to store arrays and hashes gets you a decent way there, though, so that might be good enough.

@nviennot
Copy link
Collaborator

http://nobrainer.io/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants