How to do a well structured data model

Hi Folks

I need light on DB architecting…

So, my app is a personal finance.

1 user will have many expenses accounts. Each user should start with a model that has at least 6 accounts according to my method.

Those account records, acoordind to bubble are things, but they are also related to other things that are “account_types”.

So Account_types are common and fixed to all users.

But each user start with their own private 6 “specifc” accounts" and they can create another ones, as long as they are linked to the respective "account type"s.

So my account_types must be pre-filled before the 1st user is onboarded.

To provision the first 6 accounts to the 1st user, I thought on having a auxiliary “template_acounts” table, with only the base 6 account model, and to “copy” those 6 models to the main “accounts” table when users are signed up and provisioned.

That means that in the End I would share the “accounts” table among all APP´s users, ensuring (thru privacy) that they only see the accounts records that are related to them.

Is this all Bubble best practice?

Cordial

Daniel

  1. If “account_types” are fixed and static - I would recommend you go with just a text field. You still can use it in search, sort etc.
  2. When a first user is created - just create 6 entities (records) defined in 6 steps. No need for copying.

Hi Daniel,

Have you considered creating another Thing to store mapping between a user and his provisioned account types?

So, if I understand you correctly, you have three (3) Things - User, Account, and Account Types. Then I suggest to add one more, User/Account Type provisions.

Cheers!

Yes keep them separate, so have the following data types: Users, Accounts, Transactions.

Make sure you store the account on the transaction, not the other way around.