Relationships between tables

Hello AppSheet community
I am making an app for inventory control.
I have:
Two related tables: entries_header and entries_detail, exits_header and exits_detail.
The question is:
Is it better to create the app’s schema as I mentioned above, or a single table with the movements, and how do I relate the header tables to the movements table.
Thank you and regards.

1 Like

Hello @koviac, I would suggest having a relational database as developing a scalable application begins with an optimized data architecture. While a single “flat” table is simple to set up, it often leads to data redundancy and maintenance challenges as your app grows.

In a Single Table (Flat) structure, all data points, even those that repeat are stored in one place. For example, an “Orders” sheet might repeat a customer’s full address every time they make a purchase. This leads to data redundancy and increased risk of entry errors.

In a Relational Database, data is categorized into logical tables (e.g., Customers, Orders, Products). These tables are connected through References, ensuring that each piece of information is stored exactly once. This architecture provides:

  • Data Integrity: Update a customer’s phone number in one place, and it reflects across all related orders.

  • Navigation: Seamlessly jump between a product and all orders that include it.

  • Efficiency: Smaller, focused tables improve app performance and sync speed.

Please refer to this video and the support article for more information.

2 Likes

@Shourya_Tomar’s suggestions are valid, but presented in terms that might be a bit intimidating. I recommend you try this article:

2 Likes