tags:

views:

642

answers:

7

I have finally decided to go with the Entity Framework since it has the best performance out of all the ORMs. But before I start reading and writing code I just want to know if there are any high traffic websites out there that use ORMs.

+6  A: 

I know in one of the podcasts, Jeff mentioned that stackoverflow uses Linq-to-SQL

oykuo
+12  A: 

Currently, the released version of EF, v1.0 in .NET 3.5, has terrible performance. I did extensive testing and had several long email discussions with Microsoft on the subject over a year ago when it was first released. EF's current efficiency has a LOT to be desired, and in many cases, can generate absolutely atrocious SQL queries that decimate your performance.

Entity Framework v4.0 in .NET 4.0 is a LOT better. They have fixed most, if not all, of the poor SQL generation issues that plague EF v1.0 (including the issues I presented to them a year ago.) Whether EF v4.0 has the best performance is really yet to be seen. It is more complex than LINQ to SQL, as it provides much greater flexibility. As a release version is not yet available, its impossible to say whether EF v4.0 will be the fastest or not.

An objective answer to this would require an objective, unbiased comparison between the major ORM contendors, such as EF, LINQ to SQL, nHibernate (preferably with a LINQ provider), LLBLGen, and even some of the newcommers, such as Telerik's ORM, Subsonic and the like.

As for large-scale, high-volume production systems that use ORM's. I would suggest looking at StackOverflow.com itself, which uses LINQ to SQL. SO has become one of, if not the, top programmer communities on the Internet. Definitely high volume here, and this site performs wonderfully. As for other sites, I couldn't really say. The internal implementation details of most major web applications are generally a mystery. Most uses of ORM's that I know of are also for internal, enterprise systems. Financial systems, health care, etc. Object Databases are also used in the same kinds of systems, although they are much less frequent. I would so some searches for ORM use and high volume web sites.

One thing to note in your search. Make sure the reviews you find are current. The ORM scene has changed a LOT in the last two years. Performance, efficiency, capabilities, RDBMS tuning capability of dynamic SQL, etc. have all improved significantly since ORM's were first created around a decade ago.

jrista
That's strange, my experience of the EF was it produced very optimised queries especially with joins, compared to NHibernate atleast.
Chris S
If I could dig them up, I have several threads on the old msdn EF forum that demonstrate some of the truly atrocious SQL generation that EF v1.0 had. I compared the generated SQL from L2S to that of EF, and not only was the SQL a monstrosity of several levels of nested selects, joins on null, and other oddball crud...it performed about 10 ORDERS OF MAGNITUDE worse than the L2S query. In one case, I was trying to select 90 records from a join on a couple hundred. The EF query joined in such a way that SQL Server had to filter through 50 BILLION virtual rows internally.
jrista
+2  A: 

While not directly addressing which ORM is faster as Ayende (NHibernate author) points out can be very easy to do wrong or at least slant the way you want it to, here are apps out there that are using ORMS as part of their applications.

Twitter is (was?) using Ruby on Rails (RoR) which uses an ORM. The 37 signal guys use RoR for their apps .... I know these aren't .Net but as mentioned by kuoson, L2S is employed by SO and there are alot of people out there using NHibernate like Jeffrey Palermo and Headspring. I wouldn't be surprised to find many recently developed web apps are employing an ORM.

Even if an ORM does cost you a hit on performance, most ORM's allow you to customize the SQL used when necessary. Most suggest using the ORM and then fixing bottlenecks as they arise. Additionally, a good ORM solves so much for you that writing your own DAL is becoming a much tougher sell these days.

klabranche
Twitter switched away from RoR for their backend processing, mainly for performance reasons.
Michael Borgwardt
True, but that doesn't mean ORMs can't perform. :)
klabranche
+4  A: 

jrista is right on. I just want to add that you should seriously consider LINQ to SQL. From both a simplicity and a performance standpoint it is the better technology (for now). It is very fast and reasonably capable out-of-the-box. If you want to further improve LINQ to SQL, check out the PLINQO framework.

PLINQO is a framework that sits around standard LINQ to SQL and adds a ton of features including some very elegant bulk operations and caching features. Best of all PLINQO adapts to changes in your database schema but preserves your custom code. Which is VERY slick and, in my opinion, the most valuable aspect.

Stephen M. Redd
PLINQO is not free and LinqToSql has a lot of problems. Subsonic provides great simplicity for free. NHibernate scales for free.
Michael Maddox
Yeah, PLINQO is free. Codesmith isn't, if that's what you mean
Rafe Lavelle
A: 

Sure, reddit uses parts of SQLAlchemy (for reasons unknown I believe they rewrote most it :/). Most, if not all of the large Django websites use the ORM (including the former Pownce and Curse).

Alex Gaynor
A: 

Worm supports caching and it is very useful feature for large sites. It reduce batch requests at times.

Alexey Shirshov
+4  A: 

The really high traffic websites are in fact moving away from SQL databases altogether because with write-heavy workloads common in today's apps, it's nearly impossible to make them scale beyond one machine, ORM or no ORM. This has been dubbed the "NoSQL movement"

However, while this is a very fashionable topic, it's completely irrelevant for sites that don't have thousands of active concurrent users. And worrying about ORM performance is a similar matter: most sites are not in fact "high traffic" enough for an ORM to become a problem (unless grossly misimplemented or -applied).

Michael Borgwardt
I like this answer because it is different from the rest.
RichardOD