Skip to content

Re-add schema pulling #8229

Closed
Closed
@mtrezza

Description

@mtrezza

New Issue Checklist

Issue Description

Parse Server 5 introduced schema hooks with the option databaseOptions.enableSchemaHooks in #7214. There are potential performance downsides using the MongoDB change stream.

The MongoDB change stream works by setting a cursor on the MongoDB oplog collection. If many Parse Server instances are behind a load balancer, each one will open a change stream and set an oplog cursor. Each cursor adds an overhead to the MongoDB cluster resources in terms of CPU and RAM consumption.

There may be deployments in which schema hooks are disadvantageous. If the schema doesn't change much, it's unnecessary to constantly maintain the database cursors and the previous solution of pulling the schema in regular intervals may be much more economic. In hindsight, it seems that schema hooks should have been added as a optional feature, not a mandatory change.

Steps to reproduce

Run many server instances in a cluster with high write frequency and watch the MongoDB resource consumption increase significantly.

Actual Outcome

The developer has no choice and is forced to use schema hooks, or restart all server instances on every schema change.

Expected Outcome

The developer should have the choice of pulling the schema in defined intervals, as was possible with Parse Server <5.

Workaround

Disable databaseOptions.enableSchemaHooks and restart server instances whenever schema changed.

Environment

Server

  • Parse Server version: 5.7.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bounty:$50Bounty applies for fixing this issue (Parse Bounty Program)state:releasedReleased as stable versionstate:released-alphaReleased as alpha versionstate:released-betaReleased as beta versiontype:featureNew feature or improvement of existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions