Good Model for Firestore Database

46 views
Skip to first unread message

Jue

unread,
Aug 5, 2021, 5:51:22 PM8/5/21
to Firebase Google Group
Hey,

I am relatively new to Firebase and I am about to plan an app about that has books that are stored in categories. Each book has a title, a subtitle and one or more authors. Besides that, every book contains one or more chapters, where a chapter contains texts (headings, paragraphs and list-items -> I need to identify the type of text later for styling).

As I am new into this, I am not sure how you should store the data best with Fireabse in Collections and Documents. The data won't change later on, but read operations are done more often.

So please give me some advice what is good practice in my case. Here is my first attempt:

Collection: categories
    -> a Document for each category
    Each Document has a subcollection books
        -> a Document for each book in this category:
            title, subtitle and an array for the authors

But what should I do with the chapters? Should I do another subcollection for each book? How should I store the styling information of each text (heading, paragraph, list-item)?

Thanks for some advice for my beginner's project!
Reply all
Reply to author
Forward
0 new messages