novuhq / novu

Open-Source Notification Platform. Embeddable Notification Center, E-mail, Push and Slack Integrations.
https://novu.co
Other
35.44k stars 3.92k forks source link

refactor(api): remove $or query for hash on env #6969

Closed scopsy closed 1 week ago

scopsy commented 1 week ago

What changed? Why was the change needed?

This should help with some of the ee API key transaction performance

Screenshots

https://github.com/novuhq/packages-enterprise/pull/243

Expand for optional sections ### Related enterprise PR https://github.com/novuhq/packages-enterprise/pull/243 ### Special notes for your reviewer
SokratisVidros commented 1 week ago

@scopsy We need to add the index to the Mongoose environment schema.

scopsy commented 1 week ago

@SokratisVidros why removing the caching for this? This will create a lot of pressure on MongoDB for information that rarely changes.

I'm very much concerned with the negative effect of removing the caching here at scale without properly monitoring it with a Feature flag

SokratisVidros commented 1 week ago

@SokratisVidros why removing the caching for this? This will create a lot of pressure on MongoDB for information that rarely changes.

I'm very much concerned with the negative effect of removing the caching here at scale without properly monitoring it with a Feature flag

It won't stress Mongo. Environments don't grow extremely fast; the index is super small in size, and it will always be in Mongo memory, making it work exactly like the Elastic Cache.

It also removes the need to invalidate this cache in other places of the codebase.

netlify[bot] commented 1 week ago

Deploy Preview for novu-stg-vite-dashboard-poc ready!

Name Link
Latest commit f4f9029ed788d4cc4481d777b542a824bc0e1c5f
Latest deploy log https://app.netlify.com/sites/novu-stg-vite-dashboard-poc/deploys/67338052a947e100083d10ec
Deploy Preview https://deploy-preview-6969--novu-stg-vite-dashboard-poc.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

scopsy commented 1 week ago

@SokratisVidros i'm ok for trying this, but we must look on the metrics post deployment to look for any negative effects and roll back immediately.

SokratisVidros commented 1 week ago

@SokratisVidros i'm ok for trying this, but we must look on the metrics post deployment to look for any negative effects and roll back immediately.

Of course.