parse-community / parse-community/parse-server
Parse Server compatibility with Serverless environment
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 21.4k
- Forks
- 4.8k
- Avg merge
- 7h 45m
- Merged PRs (30d)
- 11
Description
New Feature / Enhancement Checklist
- I am not disclosing a vulnerability.
- I am not just asking a question.
- I have searched through existing issues.
Current Limitation
I'm currently investigating the usage of Parse Server in a serverless env. The current tested setup is:
- Parse Server with Defined Schema and GraphQL packaged in a Docker image
- This Docker image is used on Google Cloud Run, with CPU allocated only during init/requests
- Use MongoDB Atlas Serverless as the database
Refactors/workarounds:
- Parse Server express app call
listen()too early (before serverStartComplete), so request cloud be routed to parse-server with a partial/incomplete initialization. For example, defined schema migration could not be finished. A workaround is to call a new "parse.expressApp.listen(1339)" on a different port in serverStartComplete to tell the serverless env (GCP Cloud Run) to start sending requests to the 1339 port.
Errors:
- Mongo Collation on Serverless service, reported here: https://github.com/parse-community/parse-server/issues/7937
Limitations:
- On many serverless env background tasks (actions performed after a request is returned by the server): like Parse.Jobs will not work
- LiveQuery needs an additional setup (not tested)
Stats:
- Parse Server with defined schema start in 7sec when Parse needs to create all schema (should only happen one time)
- Parse Server with defined schema start in 3-4sec when Parse is already initialized (defined schema done, DB init done, etc...), this is the real cold start if Parse Server scale to 0 instances.
Feature / Enhancement Description
The cold start is mainly related to dependency size.
To reduce cold start we need to start some code splitting. All adapters should be moved out of parse-server. Developers should be able to only import wanted adapters/servers, like LiveQuery, GraphQL server, PostgresAdapter, etc...
Then some tiny cache optimization could help to make the parse-server start under maybe 1-2sec.
Example Use Case
Fully serverless usage (with mongo serverless) to allow Parse developers to leverage Serverless computing like:
- No infra management
- Super scalable
- Scale to Zero
- Huge cloud cost reduction
Alternatives / Workarounds
None
3rd Party References
Cloud providers that support scale to zero container instances
https://cloud.google.com/run
https://www.scaleway.com/en/serverless-containers/
https://docs.microsoft.com/en-us/azure/container-apps/
https://aws.amazon.com/ecs/
Database provider with serverless (pay as you go) pricing
https://www.mongodb.com/cloud/atlas/serverless
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by examining the serverStartComplete and parse.expressApp.listen flow, then review how the GraphQL, LiveQuery, and PostgresAdapter components are packaged into Parse Server. The issue does not name files or tests; completion would require a defined code-splitting design, serverless-safe initialization, and measured improvement in dependency size or cold-start time.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, google-cloud, graphql, javascript, mongodb, node.js
- Domain
- backend, cloud, performance
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100