I want to make a game that saves data for a person’s post and other people can comment on it.
This data would then be used to either be like how the game one note, forever does it or the way social media does it(Recommending in home page). I haven’t decided which way I wanted yet.
You might wanna look into Object-Oriented paradigms. A single post can be an object (containing multiple comment objects). That way, you can also store any other relevant information about the user’s post. And, it’s easily manageable once you got everything set up. This post covers the basic you need to know to get started.
One way you can do this is through pagination. For example instead of saying post.comments = commentsData and storing all the comments inside the post data do post.comments = amountOfPages/pageIds. For each page have a limit of comments, for example 100 comments per page, and also introduce a limit on how many replies a comment can get(for example 500) and store each page under a different data store key. Then when a user scrolls downwards and the comments run out, simply load the next page from the datastore.
You can take this a step further and make each page link to the next one and eventually create a linked list. Although I doubt any of the posts will have enough comments under them so solely the references of the pages added together will make the initial post datastore key pass the 4MB limit.