Skip to content

Schema versioning pattern with Cosmos DB #23753

@alexeymarkov

Description

@alexeymarkov

Hello,

I would like to implement the schema versioning pattern with for EF Core Cosmos DB.
I do not care about missing properties in queries and indexes and just want to have a full backward compatibility with old versions and avoid service downtime.
So the idea was to add a shadow property "schema_version" to each entity and and to migrate the data if necessary during reading.

Questions:

  1. How to intercept data reading (I need to read and modify a pure JObject before EF builds a real entity from it)
  2. How to intercept data writing to add the shadow property

Thank you.

Metadata

Metadata

Assignees

No one assigned
    No fields configured for Feature.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions