Database designs provide the blueprints of how the data is going to be stored in a system.
Database design is a vital component of any app, and it determines what data to be stored and how the different data elements interact. A proper database affects the overall performance of an application. We're using a Firebase Database for our app. We prefer Firebase over SQLite since this is a multi-user app and FireBase is preferred over SQLite for Multi-User Apps.
Google Firebase is Google-backed application development software that allows developers to develop Android, IOS, and Web apps. It can be used for user authentication and to host a real-time database. The database design for our app is given below.
We store all the information corresponding to the customer using the Customer's Mobile Number as the Key, and for vendor, we store all the information using the OutletName as the key.
Under the Customer subtree, it has three children, namely, Cart, UserData, and the TransactionHistory.
1) Cart
The Cart will store the list of items in the cart of the customer. Every child in the cart will have four children, namely
- Name of the Item
- Price of the Item
- URL of the picture
- Quantity of the item
2) User_Data
Under this, we store all the information pertaining to the user. This child is common for both Customers and Vendors. Every child in the User Data will have four children, namely
- Password
- PhoneNumber
- Username (Name of the Customer / Outlet Name)
3) Transaction_History_Customer
Under this we store information regarding all the orders placed by the customer. Every child in this node will have
- Amount of the Transaction
- The outlet from which they purchased
- Transaction ID
4) Menu
Under this node, we store the menus of the individual outlets. Every child in this node will have
- Name of the item
- Price of the item
- URL of the item
5) Transaction_History_Vendor
Under this we store information regarding all the orders received by the outlet. Every child in this node will have
- Amount of the Transaction
- Phone Number of the customer
- Transaction ID
Comments
Post a Comment