I am having a situation that everyday there will be around 1000 rows of data generated from postgresql db. These data will be served for frontend, which will be frequently call.
Actually for each time the front page re-rendered, I need to randomly fetch 100 rows from it.
For my knowledge, I have two choices to achieve what I want.
Use Cloud Storage, generate a json file and save it in storage. Each time I just fetch the data by
storage.bucket('my-bucket').file('my-file.json').createReadStream();
and pick 100 rows to generate front page.Use Firestore, save 1000 rows data, pick 100 rows by
queryRef = postsRef.whereField("random", isGreaterThan: random).limit(to: 100)
I have no idea how to judge which one is more suitable for my case.
I think second method need more cost, as Firestore priced by read/write times. But probably with better performance. Is this true?