Skip to content

Improvement: Database Connection Caching #188

@Sibsankar-de

Description

@Sibsankar-de

The MongoDB connection in lib/db/mongodb.js is established on every call without caching in development mode.

Impact:

In development with Hot Module Replacement (HMR), this can lead to "Too many connections" errors as connections aren't reused.

Fix:

Implement a caching mechanism (using global) to reuse the connection across hot reloads.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestjwoc-2026For JWoC evaluationmediumGood for those who knows how things work, mostly includes enhancements of implemented features.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions