Database structure

Options
I am figuring out how Xano works and am I trying to make a basic book app to figure it out. I have a question regarding how to set up the database.
I have a list of books. Furthermore I want to add the book to my collection.
Other users of course also can add a book to their collection.

What's the best way to store it in a database? Simply make a table MyBooks with the following fields:
book_id, user_id, and status?

Or is there a possibility to add a sub to the book table with these fields (maybe an array?)

Thanks!

Comments

  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options
    Both ways are possible. From more of a personal opinion, I like the MyBooks table with that schema - especially if you are going to introduce more and more users and books lists can grow larger and larger - it will make things easier to manage.

    Xano does support arrays and objects, which can come in handy when the lists or metadata of these stay at a manageable length. Xano also does full object replacements so when you go to update one of these in your API, you're updating everything.