Database structure
Options
![Rick Derks](https://us.v-cdn.net/6037124/user_avatars/2684473.jpg)
Rick Derks
Member ✭
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!
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
-
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.
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback