How is the relations' performance in 4D v17?

Hello everyone, me again.

well, now we have an important discussion about how we can use relations in 4D for reports and forms, we had some very bad experiences using relations on 4D v11 that pushed us to change how we should use it, the immediate solution was putting extra fields in our tables storing all IDs of tables that we need related for reports, but personally i think that this is a very bad practice, because you lose your database normalization.

I know that ORDA improves greatly the use of relations, but we don’t have enough experience using relations with 4D 17 and it’s possible mistakes

I appreciate if any of you could tell us your experiences using cascade relations for your reports and use in forms and stuff like this

I hope I have been clear and you can understand my concern

Thanks a lot for your help

Hi,

some words in generally.
The performance of ORDA is very good. Specially relations.
My advice: use ORDA for new development. For me, i am rewrite everything i am touching and i have to refactoring some methods.

Because of ORDA, you will have much better readable code and much smaller methods. And you will have no side-effects anymore. And the locking is much better.

Example:

[]29640230[/]

Hi,

Yes, with ORDA the use of relations is easy and powerful.

To start, on this page --> https://doc.4d.com/4Dv17R5/4D/17-R5/Glossary.200-4163767.en.html

you’ll see that relations implemented with foreign keys and many to one / one to many links become attributes of the dataClass itself.

A many to one relation gives an attribute which is an entity.
A one to many relation gives an attribute which is an entity selection.

Then you can use them as a dataClass’s attribute in your code to navigate on your data model.

For example, in this blogpost and attached HDI --> https://blog.4d.com/query-your-database-with-an-object-oriented-approach/

you’ll see how to take advantage of a recursive link to easily query your database.

I advise you to check those two blogposts and database examples which are very useful to run relations in ORDA:
–> https://blog.4d.com/orda-genealogy-episode-one/
–> https://blog.4d.com/orda-genealogy-episode-two/

Do not hesitate to contact me if you have questions.