Thoughts on a DB redesign
Hi all -
So I've been developing my team show jumping DB the last few years quite organically. I knew almost nothing about setting up a DB when I started and had zero knowledge of DB coding.
This is my current data model:
What a mess. I wondered what it would look like if I started from scratch with what I know now. Well here is my first draft of a new DB:
Not all tables are in the new model but the most important ones are.
This is one area I wish Ninox would spend a bit more time on. One I wish they would allow us to move tables around.
As you can see the big change is the moving a lot of tables into a child relationship to Leagues. All those tables you see under Leagues wouldn't exist without a League record (currently track two leagues (Global Champions League and Major League Show Jumping and will add the new League of Nations next year). All the tables you see that are outside the Leagues table are tables with data that can exist if a league exist or not and can be apart of different leagues.
One reason I started a redesign, is to make my stat dashboards/pages easier to create. I can create a reference field that I can select the League then I am automatically linked to all the relevant data.
My only hesitation is moving the data across and having everything link properly.
Anyways, thanks for reading.
23 replies
-
Would be great if one could set up data models like in MSAccess.
-
Gosh Fred
Those images look like route plans themselves of a showjump circuit..
Good luck with this. Big job but i can actually follow your revised layout
I'm too embarrassed to show you my model as that too has grown as I have learned !!!
-
Data models are fun:
-
too complicated.
-
I come from a FileMaker background. The look of the relationship diagram there is totally in the developer's hands but even so, I have seen far, far worse than any of the above examples. It takes considerable determination to keep an RD looking pristine and it may be by design (pardon the pun) that Ninox have kept this out of developers hands.
Regards John
-
It kind of reminds me of this! (as being from Birmingham)
However, I did think in the likes of MS Access/Dataease etc that you could dragg the relationship scheme icons around to try and tidy it up tho.
-
Here is an update on my data model redesign.
I couldn't have done it without Ninext as I can find all of the links I was going to break and point them to the new path as I moved things around. I see that I duplicated a lot of data before and now data is more accessible.
Still a work in progress, but am liking the direction it is going.
-
I think I'm done for now. I've removed unnecessary table links and cleaned up my dashboards so I'm using links instead of selects and everything is running smoothly.
I can almost follow all of the links!
If they ever give us public cloud users the ability to access different DBs then I'll need to redesign everything again. :)
-
Excellent work Fred. Looks like a big part of your success is down to recognising and setting Composition correctly. You have some nested three (or four?) deep.
-
Hi , congratulations on the successful redesign of your database!
What impressed me that I couldn't think of is how you minimized the use of "select”.
We can create a one-to-many (1: N) relationship between a Page (Dashboard) and a Table to access records directly using Dot notation links. Isn't that what you are saying?Is this particular practice something that Ninox encourages?
-
Here is an example of how to use relationships to fill in dynamic fields or views:
Step 1: League is a dynamic choice field to the table Leagues.
Step 2: Event is a dynamic choice field with the following code:
let xL := record(Leagues,number(League)); xL.Seasons.Events[Year_calc = year(today())] order by -yearEOsort
Oops, looks like I can make the above code better by moving the filter to the Seasons level. There are fewer Seasons records (one for each year) so it is better to filter at the level then at the Events level, where there are 16 records.
Step 3: Select a Team is a dynamic choice field with the code:
let xLoc := record(Events,number(Event)); xLoc.Season.ActiveTeams order by displayName
Step 4: Select a Rider is a dynamic multichoice field with the code:
let xSeaAct := record(ActiveTeams,number('Select a Team')); if 'Full Rider List' = 0 then xSeaAct.'Team Membership' order by RiderNames.lower(LastName) etc.
There is more but this gets the point across.
As you can at each level I'm using the power of relationships to get the data I need instead of doing selects. Well, first I'm getting the appropriate record from the selection using the record() command, but since I can pinpoint the record it is very fast for Ninox to get it.
I hope this helps.
-
I just wanted to take a moment to say a huge thank you to you! Your post motivated me to redesign my main dashboard by using the new Ninox pages with the aim to minimize "select" use.
As you suggest, although it seems counterintuitive, I created a reference from my main table to the dashboard.
I was able to zero the use of "select" and all record() by taking advantage of the capability for filtering at each level!
For example:
'main_table '[Id = 1] . 'sub_table' [field = "text"] . 'sub_sub_table' [field > 0]In my new Dashboard, the data appears lightning-fast!
Content aside
- 1 yr agoLast active
- 23Replies
- 329Views
-
6
Following