How is RIA services for relational data efficiency?

I have been researching RIA services with silverlight 4 and considering using it. Switching to silverlight from ASP gives me some concerns about the maturity of silverlight for data driven apps.

I was looking at relational data queries. Lets say I have a 'person' table and a 'cars' table. Multiple cars can be associated with a person. Now if I do queries with relational data I have to specify to include the additional tables to be returned to the client from the server. Shown here:

http://timheuer.com/blog/archive/2010/01/05/master-details-with-ria-services-and-includedresults.aspx

I am a little concerned with efficiency. If I do something like this, it appears I am potentially sending multiple rows from the car table for each person row (since its one to many). However, I may only want the name of the car and not other columns. A more complex example with a bunch of relational joins to other tables could get ugly. Is there any way to address this? I don't see much info on custom/complex types or how ria services handles database views.

Another thought of mine is if I have relational data that loops back on itself will that lock up a query. For example if person links to a car and car links to some other table and that table links back to person. It could seemingly loop forever?

1
задан Adam 19 August 2010 в 16:40
поделиться

1 ответ

Объем данных, передаваемых (или нет) с помощью служб RIA, полностью зависит от вас. Вы не обязаны включать все данные дочерних таблиц. Да, можно написать действительно неэффективные запросы данных, но также можно сделать их оптимальными.

Бесконечные циклы обычно не встречаются в ER-моделях. Это ничем не отличается от выполнения объединения таблиц в SQL.

Если вы действительно заботитесь о максимальной эффективности (что маловероятно на первых порах), вы, вероятно, будете использовать SQL store procs в любом случае на стороне сервера и задавать этим procs определенные параметры для выполнения тяжелой работы.

Я построил несколько больших систем с Silverlight 3 и сейчас работаю с 4, и лично мне будет трудно вернуться к ASP.Net. В нем проще разрабатывать (как только вы узнаете его причуды) и он действительно очень веселый :)

Надеюсь, это поможет.

2
ответ дан 2 September 2019 в 21:59
поделиться
Другие вопросы по тегам:

Похожие вопросы: