开发者

What does it mean that Linq To SQL is not scalable?

开发者 https://www.devze.com 2022-12-08 05:56 出处:网络
I\'ve once heard from some developers that L2S is not scalable. I\'m not sure that I fully understand what that means.

I've once heard from some developers that L2S is not scalable. I'm not sure that I fully understand what that means. I guess that it has something to do with the layers in your app (provided your app is a layered one). Can someone please shed some ligh开发者_JAVA技巧t on this subject?

Thanks, Avi


This is more of a functional scalability. If you look at your LINQ generated domain objects you'll notice a lot of bloat, which may become unnecessary if you were to move to another persistence framework such as NHibernate. One options is to roll out your own domain layer which is more abstract and map your generated domain to the abstract one. Keeping your domain layer 'bloat-free' allows you to reuse it with different persistence frameworks. L2S isn't very good at it. Other things may include performance, but i thought this was improved in later versions?


I think it scales reasonably well, taking in account that Stack Overflow uses it and it is not a small site.


Even if your collections are small, the SQL generated by a code generator is never going to be as optimized as hand-coded SQL, particularly if getting a good execution plan is highly dependent on picking the right indexes.

Assuming you hand-code these cases and use SPs, in cases where data is very large, you are going to need a lot of tricks to have efficient memory usage regardless of whether your database engine can help you or not.

But every abstraction has limits.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号