Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR]: Enable No-Persistence / No-Cache Queries #12397

Open
johnfrancmartin opened this issue Feb 16, 2024 · 5 comments
Open

[FR]: Enable No-Persistence / No-Cache Queries #12397

johnfrancmartin opened this issue Feb 16, 2024 · 5 comments

Comments

@johnfrancmartin
Copy link

Description

Use Case

I'd like to be able to make certain queries explicitly with no persistence. Given large cached collections in persistence can impact performance, there are some larger documents that I'd like to query when needed but never persist.

How the Firebase SDK currently handles it

Persistence settings are set globally at Firestore initialization, there is currently no API to enable certain queries to sidestep cache.

How you propose the Firebase SDK should handle it

Either: allow the creation of alternate Firestore instances, with different persistence settings, or, allow queries to provide a disableCaching option, that skips persistence.

API Proposal

No response

Firebase Product(s)

Firestore

@google-oss-bot
Copy link

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@MarkDuckworth
Copy link
Contributor

Hi @johnfrancmartin, Thanks for the feature request. I'll review this use case with the team.

Can you create multiple Firestore instances via multiple Firebase app instances using firestore(app:), and configure persistence settings for each?

@MarkDuckworth
Copy link
Contributor

I reviewed this with the team and this is something we have been considering, so your request helps us prioritize it. For now, the only additional workaround I have is to get the documents you do not want to cache within a transaction. You will not be able to run a query within a transaction, but you can get individual documents by ID.

@MarkDuckworth MarkDuckworth self-assigned this Feb 16, 2024
@johnfrancmartin
Copy link
Author

@MarkDuckworth any updates on this?

@MarkDuckworth
Copy link
Contributor

@johnfrancmartin, no, I don't have a timeline for this feature yet. We're you able to implement a workaround with a second FirebaseApp instance or using transactions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants