vee
vee

Reputation: 739

Firebase Read and Write Speed

Suppose I am creating a transaction app.

Upvotes: 2

Views: 922

Answers (1)

Faruk
Faruk

Reputation: 5821

First, rather than filtering history of transaction data using username I would suggest using userId which will never changed and always unique.

Second, I think saving the transaction globally (without using '/userId') is better. Because :

  1. We need to able to summarize all transactions for accounting reason
  2. If you think the query will be slow even after using index, you can consider loading part of query result using limitToFirst() just like pagination in web (infinite scroll in android). There is great tutorial here

Upvotes: 2

Related Questions