Optimizing and scaling Firebase for improved performance

Is it possible to efficiently retrieve schedules from a database with thousands, or even millions, of records in the future?

I am planning on storing schedules from healthcare professionals in a collection, but I am unsure if it is better to store them within the professional's entity or within the unit itself.

While Firebase allows for the creation of indexes, I am concerned about retrieving schedules in a simple manner.

1. Initial Approach:

db.collection('unity').doc('6BfbptQ8blacBLi1GNIJ').collection('schedules').

2. Alternative Approach:

 db.collection('unity').doc('6BfbptQ8blacBLi1GNIJ')
.collection('professionals').
doc('Z6JDd0Ek7WO8yqiZJkBuJooF1FH3')
.collection('schedules').

The second way would require traversing through all professionals in the unit to gather their schedules and aggregating the counts, which might not be optimal.

I am curious about the performance implications when dealing with collections containing thousands or millions of records.

Answer №1

The success of transferring data depends greatly on the amount of information being processed. While handling thousands of documents may seem manageable, one must consider the potential costs associated with network transfer and memory storage on the client device. It is important to take into account the amount of data being moved and the time it will take to complete the transfer.

Without a clear understanding of the specific query results, network capabilities, and available memory resources, it is difficult to determine if this process will be successful. Performing your own benchmarks is recommended for accurate evaluation.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

How to retrieve the NgModel Object within a component file using TypeScript

I am currently utilizing [(ngModel)] for two-way binding. The structure in HTML is as follows - <input type="text" [(ngModel)]="emailInput" #toemail="ngModel" [email]="true" [style.color]="toemail.invalid && toemail.touched ? &a ...

switching the content of a button when it is clicked

I am currently using Angular 7 and I am trying to achieve a functionality where the text on a button changes every time it is clicked, toggling between 'login' and 'logout'. Below is the code snippet I have been working on: typescript ...

Injection of environmental variables into app services

Through the use of Nx, I have created multiple apps that each have their own environment with different API URLs. The Nx Workspace library includes shared services that are utilized among all apps, however, it is necessary to pass the environment-api-url w ...

When incorporating a JS React component in TypeScript, an error may occur stating that the JSX element type 'MyComponent' is not a valid constructor function for JSX elements

Currently, I am dealing with a JavaScript legacy project that utilizes the React framework. Within this project, there are React components defined which I wish to reuse in a completely different TypeScript React project. The JavaScript React component is ...

Preserve line breaks within HTML text

Utilizing the powerful combination of Angular 5 and Firebase, I have successfully implemented a feature to store and retrieve movie review information. However, an interesting issue arises when it comes to line breaks in the reviews. While creating and edi ...

What distinguishes injecting a provider in Angular2's @Component versus @Module?

When working with Angular2, it is possible to specify the providers in either a @Component element or in a @NgModule element. For example: @Component({ selector: 'app-home', templateUrl: './home.component.html', styleUrls: [&apos ...

Validation in Angular2 is activated once a user completes typing

My goal is to validate an email address with the server to check if it is already registered, but I only want this validation to occur on blur and not on every value change. I have the ability to add multiple controls to my form, and here is how I have st ...

Unable to resolve external modules in TypeScript when using node.js

I wanted to integrate moment.js into my node application, so I proceeded by installing it using npm: npm install <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="adc0c2c0c8c3d9ed9f8399839d">[email protected]</a> J ...

Steps for including a component in a loop using Angular 6

I'm working on a component that contains two input fields. The goal is to have a row pop up every time the user clicks on the add button, with all the inputs eventually being collected in an array of objects. For example, the component template looks ...

Testing TaskEither from fp-ts using jest: A comprehensive guide

Entering the world of fp-ts, I encounter a function (path: string) => TaskEither<Erorr, T> that reads and parses configuration data. Now, my challenge is to create a test for this process. Here is what I have tried so far: test('Read config& ...

Misunderstanding the concept of always being right

Here is a code snippet that raises an error in TypeScript: class Status { constructor(public content: string){} } class Visitor { private status: Status | undefined = undefined; visit(tree: Tree) { if (tree.value > 7) { this.status = new ...

When implementing JSS with React and TypeScript, certain CSS properties may encounter a `type is unassignable` error

Recently delving into TypeScript, I've encountered an issue within my project that was created using create-react-app with TypeScript and incorporates JSS. It appears that certain CSS properties are causing errors. Specifically, the pointerEvents and ...

React: The Material-UI autocomplete input, controlled with the React Hook Form `<controller>` component, experiences issues when the `multiple` prop is set to `true`

Currently facing challenges with managing an autocomplete MUI component using the <controller> component in react-hook-form. Take a look at the code snippet below: <Controller control={control} name="rooms" render={({ field }) =&g ...

Resolve the problem with Firebase real-time database

I have been facing some challenges with integrating Firebase database into my project. Despite my efforts, I am unable to insert data into the database. I have extensively searched on Google for solutions, but unfortunately, none of the responses provided ...

the ngbPopover refuses to appear

I'm attempting to utilize the popover feature from ng-bootstrap in my Angular2/Typescript application, following the guidelines at here. Despite not encountering any errors, I am facing an issue where the popover does not appear. Here is the snippet ...

The error message "TypeError: Unable to access the 'getFullWidth' property of an undefined value when using TSLint and TypeScript" was

I have been using Dan Wahlin's tutorials and online examples to set up Gulp and Typescript, but I am facing an issue with the tslint() function. The problem occurs in my code as follows: node_modules\tslint\lib\language\walker&bso ...

Having trouble getting access to FormArray content for validation due to receiving null or undefined errors

CSS Tricks <form [formGroup]="newMovieForm"> <ng-container formArrayName="actors"> <ng-container *ngFor="let actor of (actors['controls'] || []) ; let i = index"> <div [formGroupN ...

Array - Modifications do not pass down to the child component

I am observing the following structure in the code: <div id="join-container"> <join-chain id="my-join-chain" [selectedColumn]="selectedColumn" (updatedStatements)=onUpdatedStatements($event)> </join-chain> <tile-ca ...

Developing an npm library with ReactJs: A step-by-step guide

As a newcomer to React, I am eager to create my own npm library in ReactJS. Taking inspiration from my existing React project, the goal is to transform it into a package (or library) that can be easily integrated into other projects. This means allowing ...

Is it possible to dynamically change an ngModel value directly from the component?

I'm currently immersed in an Angular project and my initial file setup was like this: dog.ts: export interface Dog { name: string; age: number; breed: string; } dog.component.ts: import { Dog } from '../dog'; @Component({ //setup ...