In my Blog Application built on Ruby on Rails - 4.1.4, I want to implement "Archive/Unarchive" feature for redundant blogs. I am using both Postgresql and MongoDB. Users, Posts, and Comments in Postgresql and Archived posts in MongoDB. I'm referencing posts to user with user_id in posts table.
Now, In archived_posts collection in MongoDB, I want association of User table (postgresql) to the ArchivedPost collection (MongoDB). Is it possible to achieve such reference/relation?
In MongoDB you may reference to the records in your Postgresql user table by their ID. But there is no any referential integrity in such solution.
If you delete user record from Postgresql, record in MongoDB will still be there with id of nonexistence user. If it is a problem for your service than you'll need some kind of synchronization between user table in Postgresql and archived post table in MongoDB