wbsurfver-/E1597aS9LQAvxtiuMwx3w@public.gmane.org
2013-Oct-17 14:09 UTC
using mongodb with ActiveRecord or other ?
We recently looked at mongoDB a bit. I was discussing using mongoDB with active record but was told that maybe there are other or better options. Can someone comment on that ? Also, someone suggested storing a ruby array directly inside of a record where I would have opted for the array to be a separate set of records in active record using has_many and belongs_to .. It seemed to me that how I search on those child records would be a big factor but I soon realized I need to find out what are the options. Do people store arrays and hashes directly in mongo DB fields or is that not the best way to go ? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/a1177604-318e-4513-8c11-6b7a3977c227%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
On Thursday, October 17, 2013 3:09:33 PM UTC+1, wbsu...-/E1597aS9LQAvxtiuMwx3w@public.gmane.org wrote:> > > We recently looked at mongoDB a bit. I was discussing using mongoDB with > active record but was told that maybe there are other or better options. > Can someone comment on that ? > > ActiveRecord is pretty hardwired to SQL databases. Mongoid and mongomapperare 2 ORMs that wrap mongodb documents with an ActiveModel compliant interface> Also, someone suggested storing a ruby array directly inside of a record > where I would have opted for the array to be a separate set of records in > active record using has_many and belongs_to .. It seemed to me that how I > search on those child records would be a big factor but I soon realized I > need to find out what are the options. Do people store arrays and hashes > directly in mongo DB fields or is that not the best way to go ? >It''s certainly a compelling feature. There are pros and cons. It depends largely on how you use/access the data. For example with data in separate records, its difficult to update a parent and child without race conditions, since while individual document updates are atomic there are no transactions. Equally very large documents can be unwieldy Fred -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/fc95780d-9a85-496f-ab19-ef225fb35ebb%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.