TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: Best NoSQL methods for Rails

1 pointsby devinrhode2over 10 years ago
Mongoid, Postgres with hstore, Postgres with the JSON data type, CouchDB?

1 comment

bertomartinover 10 years ago
Recently investigating this myself. Mongoid is an Rails ODM for MongoDB. It seems like a nice one to start with as the interface is very close to ActiveRecord. I haven&#x27;t looked at the rest you mentioned, but I&#x27;ve used the relational aspects of postgres; it&#x27;s a great db, but if you&#x27;re thinking about going NoSQL, why not go the whole way? Many serious companies are using these technologies for their businesses, and they seem to have matured over the past few years. A good place to get more information on MongoDB is: <a href="https://university.mongodb.com/courses/catalog" rel="nofollow">https:&#x2F;&#x2F;university.mongodb.com&#x2F;courses&#x2F;catalog</a>. BTW, one thing to be careful of when working with nosql is that you still need to model your data and you can definitely model relationships (just that they usually don&#x27;t support joins at the db level). So, you could go through pretty much the same steps that you would when modeling data for a SQL db, but in the nosql case, it&#x27;s easier to change the schema as you go. So you can imagine an Author entity, with a bunch of Book entities embedded in a single document (MongoDB or other document oriented stores). If later, you wanna add Book to another document, then you can separate Book into it&#x27;s own document and add a relation. The difference with SQL is that you don&#x27;t do joins in the db, but with Mongoid, you don&#x27;t even see this as the relationships are defined in the models, and they&#x27;re pretty much the same as ActiveRecord. Enjoy.