Updating Schema from Old Relational Database for Instagram Posts & Comments

Hello FF wizards!

I've made an app that has some basic instagram type functionality, however, I made this a long time ago when sub collections weren't possible in FlutterFlow.

Right now, all the comments are linked like a relational database with posts and comments each being separate collections in firebase.

Each comment is then attached as a reference to its proper post like below which has been causing some performance issues understandably as this just like a huge SQL database. As the number of posts and comments grow, I have to assume this is an awful setup. What is the best way to do this so that it scales? Is it creating the comments as sub collections of each post?

Many thanks for your wisdom FF family.

2
2 replies