Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-1963

Use of polymorphic types make upgrades/downgrades really problematic

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: 6.1.1
    • Component/s: None
    • Labels:

      Description

      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?

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              emily.stolfo Emily Stolfo
              Reporter:
              darkskiez darkskiez
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: