-
Type: New Feature
-
Resolution: Won't Fix
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
Background: We have a couple of rails apps talking to the same db, imagine one db managed through a cms like thing, but with various customised frontends for different customers.
This is a bit of a large general issue we have with mongoid and polymorphic types, and is quite a philosophical design issue.
1) Newer code does not have old types blows up when they encounter them
2) Older code accessing the DB blows up when encountering new types
So we immediately lose the benefits of the schema-free nature of mongodb by imposing this schema on top.
We have tried to work around these issues by encoding version numbers into the documents which the code is aware of if it can read and upgrade those versions, however this adds huge amounts of complexity to the models for handling all of the migration nuances.
Is there something obvious we should be doing to manage this sort of thing? Should there be a big warning on polymorphic types about this brittleness they add?
- duplicates
-
MONGOID-2560 Pure polymorphic relationships
- Closed
- related to
-
MONGOID-4354 Provide more helpful error message when _type field doesn't correspond to a Class name
- Closed