PouchDB designing for forwards compatibility -
i starting out pouchdb , looking solution allow me change schema in future without major pain, don't have worry if have thought of everything. i'm seeking plan case might need change structure didn't predict (example: let's start concept of single "wish list" later support multiple named lists instead).
the high level idea have have internally-meaningful "schema version" saved every pouchdb instance. client side js read in, , if there data migration necessary, can perform before continuing. there "best practice" ways this?
there's plugin called pouchdb-migrate can use accomplish this. keeping integer version fine; can use "duck versioning" (e.g. "i'm adding lastname
field in v2, if there's no lastname
, document must v1").
Comments
Post a Comment