Best Practices for Table/Relationship Conventions

Sample size of one:

In practical terms, going to anchor buoy didn't improve speed, and in fact slowed down a few things that I had to refactor to get working at full speed again, but I kept it Anchor Buoy because I thought it would be easier... and if I'm being honest because I just spent 30 hours migrating everything over and I wanted that time to have been worthwhile.

In hindsight I wish I'd rolled back when the speed wasn't improved, but I know many people like Anchor Buoy and I will say one big plus is I can try changing the base table of a layout and sometimes get significant speed improvements, or use filtered portals in nifty ways... but overall it was much easier to do everything when the tables were one big blob and I only had ONE

Student => ClassList_Join => Courses

As opposed to also needing:

Courses => ClassList_Join => Student

And

Credits => ClassList_Join => Student

And all the others that creep up.

1 Like

Better... than WHAT? better than oatmeal? better than lego?

Reported to scale better than unified and better than selector-connector, both of which connect every Table Occurrence to every other Table Occurrence, triggering the path math.

That's an excellent observation. Do you know what that means for us? Does it have consequences or is it an artefact of the mode of representation you've chosen. In other words, why should we care?

One report (DevCon conversation) from a well known developer with a big system...

  • Unified to Anchor-Buoy = 2x as fast
  • Tested Anchor-Buoy to Selector-Connector = 1/2 as fast, AKA back to slow.
  • Back to Anchor-Buoy for the 2x faster result

We use Anchor-Buoy from the start because in small system speed is usually not a concern and they often scale up and we like it if they then run 2x as fast.

1 Like

I wish it were that simple. I've spent years looking at this stuff (pre FileMaker too).

I have one big system I rewrote from 2013 to 2018 (and before that FileMaker 6 to 7). It was originally Anchor-Buoy/multi-file, then rewritten as single file with multiple "islands" if you like.

I had the benefit of attending one of Ray's master classes and beating out the conversation around Anchor-Buoy (refer to the paper mentioned in an earlier post)...it was very interesting and I changed my thinking.

Some anecdotal observations about that big system of mine (I don't think that you can't just attribute changes to RG style, there are other factors such as themes, etc):

  • the solution is much faster now to start up (until I added more functionality to use up that extra time)
  • it is quite a bit snappier to use and is great over a WAN (the original goal of the rewrite)
  • I find the RG MUCH easier to manage, but that's me

I can't remember whether it was Ray or David Head who said "let FileMaker be FileMaker" and learn to use the two way relationships it affords (which Anchor-Buoy reduces), but there is something in that.

So multiple "islands" in the RG is more work, I think, though I think if done properly, it has a better outcomes for the solution.

I also have ideas about table name prefixes, but that's a different thread.

Rob

Indeed! I've spent twenty years working on other peoples' systems, big and small. All the way from "look at what I made" to systems designed by professionals for large scale usage. My takeaway is that Anchor-Buoy (A-B) is not the answer, it's Just Another Method (JAM).

A committed programmer can make A-B suck. I've seen Anchor-Buoy implemented in so many different ways, and implemented so badly. The worst example I saw was a system originally designed as a spawling spiderweb. At some point, the designer had been convinced that anchor-buoy was the answer to whatever problem they had. So they converted their graph to A-B. They did this by duplicating the entire graph for each major entity. They moved the table occurrence for that particular entity to the left of the sprawl. Hey presto, Anchor-Buoy! Obviously A-B did not solve their problem. It's JAM, after all. It did make things noticeably worse. All they really needed was to reduce reliance on summary fields, unstored calculations, etc., and make better use of scripting.

1 Like

nice expression!

r

I thought I read somewhere that Claris optimized that 2-3 years back and while it might still be an issue in some cases, it's not nearly as relevant as it was 5 years ago when people were converting to Anchor Buoy?

Does anyone else remember anything about that? I absolutely might be wrong about that.

I'm late to this thread and have scan read through it, so hopefully I won't duplicate some very valid suggestions above.

I believe we're in the minority here, but we always start our table occurrence names with the source table TO name and end up with the anchor table TO name. For instance, a TO based on quote line items, would be named QLI2Quote2Contact. The '2s' are historical and when pronounced 'QLI to Quote to Contact' makes sense to us. To re-emphasise, consistency is important, hence ILI2Invoice2Contact, or OLI2Order2Contact would be understandable variants.

Our namning convention is partly down to having been doing it this way for over 3 decades, but more so that, particularly in Windows, there have been, and I believe still are dialog windows that cannot be resized, hence using the converse of the above example of say Contact_Quote_QLI could appear in one of these window as Contact_Quot and there is no method of establishing the data source in one of these windows if it is at the end of the name. At the most basic level, if a layout is named the same as the TO it is based on, then we can immediately see what the source table is in browse mode within the Layout name displayed in the status area, but could not do so on longer TO names without going into layout mode.

Flexibility is important within the naming consistency. For instance, we have systems that have tables named 'Company' and 'Component', which with all the best will in the world, a 3 or 4 letter abbreviation results in 'Com' or 'Comp' for both. In this case, we simply accommodate longer TO names, often using the full table name if there could be any ambiguity.

There is no right and no wrong, as long as there is consistency throughout.

One other incredibly useful technique we use is to have a text note key in the top left of the relationship graph. For example, this could read:

1a - Contacts
1b - Companies
1c - Addresses
2a - Quotes
3a - Orders
3b - Remedials
4a - Invoices
5a - Purchase Orders
6a - Items
6b - Stock
6c - Goods In
7a - Human Resources
etc.

Each TO Group is separated from others by a text note containing one of the above values. Hence, if we want to go direct to Purchase Orders, as soon as the graph is open, we type 5a and are immediately taken to the correct TOG. Using this method we can jump around large relationship graphs. It is important to not start any text notes with dates or any other numerics, as it breaks this system. Hence, if we made a note we'd initial it first followed by the date and detail.

We come from an era where Claris/FileMaker Inc. published recommended naming conventions, which included a leading underscore for key fields. In the modern era this was as useful as using the '@' symbol as a find operator. Who was to know that email and SQL would be future features. Hence, we would not include any special characters in our table or TO names.

Regards
Andy

3 Likes

I can confirm that anchor/buoy is much faster than a selector/connector model. After the performance of my solution with S/C dropped drastically (especially in network operation), I converted everything back to A/B and since then everything has been running smoothly.

As far as A/B naming is concerned, I know and have to deal with both versions: Anchor_Buoy and Buoy_Anchor. Personally, however, I prefer Anchor_Buoy because I have the direction of view in the back of my mind: what's my source table and to what target table do I want to get to? E.g. I want to look from invoices into the line items: Invoice_lineItems
But I guess that's only a matter of taste.

2 Likes

How true. I love that!

I like A-B, for how easy it is to understand for other developers, including ā€œfuture meā€. :wink:

For naming, I prefer A-B order, and things spelled out with PascalCase for easy acronym type-ahead in the calc engine.

Naming things with B-A order is a good work-around for the FM Windows dialog ā€œbugā€ that has been around way too long. But thatā€™s one of the many reasons I couldnā€™t work on Windows.

Malcolm - the Schema file is where I manage all of the lookups, cascading deletes, and security. And it links to four distinct Interface files (each its own stand-alone app). I only ever want to define the cascading deletes once. The Schema file is where I try and represent as much as I can of my data model. But more importantly, dividing the TO relationships between the Schema file and the Interface file lets me better manage complexity. The former is all about the data model while the latter is all about the interface and things like record creation.

It's also worth noting that I don't link all my TOs together, so it's hard to compare to either a pure AB or SC model. I instead break them into function-based TOGs that are leverageable in other solutions. Indeed, ever since FM12 and the introduction of eSQL, I have defaulted to only creating a relationship where I know I will need/strongly prefer one (usually for things like portals, record creation and relational integrity management/cascading deletes).

By not automatically linking all my TOs my solutions typically have a TO-to-base table ratio of around 5 to 1, and that includes the duplicate TOs one gets from using a separation model. If I didn't use a separation model, the ratio usually goes down to less than 4 to 1, and in some apps, as low as 2 to 1. The last solution I created that used strict AB conventions had a TO-to-base table ratio of over 10 to 1.

I've always assumed that this "selected but not completely connected" approach helps performance relative to both AB and SC (although I haven't been very scientific in measuring this). But just as importantly, this kind of structure has made it less likely that I will run into my biggest challenge of all - excessive complexity that requires more of my time to manage. Alas, my brain has far fewer available processing cycles than my computer does.

Cheers

Right. It makes sense to include relationships needed for the deletes, and if you're using lookups to acquire data then they need to be able to find things (I'm more in favour of scripting data inputs than lookups). The slimmer you can make the data file the better. Each relationship forces an index to be built, and they have to be loaded when the file is opened, so reducing the number of indices in your data file will give you better performance in all of your UI files.

In this presentation by @WimDecorte, the topic of using _suffixes, for example, _acd on Table Occurrence names was mentioned.

Provides increased code readability when using the popular Anchor-Buoy method of managing the Relationship Graph.

Have a look. It might make your day!

1 Like