Possible Duplicate:
What ORM does Stack Overflow use with their ASP.Net MVC project?
The ADO Entity framework, as we all know, is replacing LINQ to SQL as the default ORM Microsoft recommends.
I just wonder whether SO is maintaining the its data access layer in LINQ to SQL, or is planning for a migration to ADO Entity for better support?
Edit: SO was using LINQ to SQL as the DAL. Just not sure whether it is still now, or in the future.
-
Do you have any reason to believe there is a different level of support for LINQ to SQL as opposed to EF?John Saunders– John Saunders2009年07月20日 02:50:03 +00:00Commented Jul 20, 2009 at 2:50
2 Answers 2
We use both Linq to SQL and SQL blob strings, depending on what we're trying to accomplish and which fits the code better.
For example, there is no way AFAIK to do a full text search using LINQ syntax. (Maybe there's some nasty hack, but I didn't find much last time I searched)
-
Ah but it all works so so well :opChris M– Chris M2009年07月20日 11:25:30 +00:00Commented Jul 20, 2009 at 11:25
-
I'm not sure exactly what you mean by "using LINQ syntax" since they're just extension methods that have some syntactic sugar, but there is a question on SO that discusses this, and I've used it successfully as well. stackoverflow.com/questions/224475/…GalacticCowboy– GalacticCowboy2009年07月20日 12:01:57 +00:00Commented Jul 20, 2009 at 12:01
-
2ugh, stored proc hack..2009年07月20日 12:29:46 +00:00Commented Jul 20, 2009 at 12:29
-
I'd be very tempted to switch to stored procedures if I had a site like stackoverflow.com. But then again "if it ain't broke don't fix it". Also, if you are considering making some tests to see how much performance gain you could get switching to stored procedures on SO, I would be interested to see the results.çağdaş– çağdaş2009年07月20日 13:15:54 +00:00Commented Jul 20, 2009 at 13:15
Edit: Definitive answer, courtesy of Kyle, is that yes, Virginia, they do use LINQ to SQL.
(削除) I'm taking a stab at this since Jeff will be able to definitively answer this, but I don't know if he'll see this question. Anyway, it seems like straight SQL to me.
- They're taking advantage of SQL Server's Full Text Search, which uses certain SQL syntax.
- They need to control the speed of queries on an ever-increasing database, and the only way to really get the right indexes and performant queries is to use SQL.
- Jeff knows SQL very well, and it would surprise me if he tried to put the data access layer in the hands of an ORM, which is a solution to a non-existent problem, if you ask me (and you sort of did).
IMO, ORMs tend to be slow and do a horrific job of optimizing queries. Of course, I'm biased because I spend most of my days in SQL, but I still think ORMs cause more harm than good. It causes app devs to think that they don't have to understand databases, which is just naive, I think. That being said, I love using LINQ with lists and XML. Just not with SQL. (削除ここまで)
-
1He did answer this several months back, and they do use LINQ to SQL: blog.stackoverflow.com/2008/09/…2009年07月20日 03:41:27 +00:00Commented Jul 20, 2009 at 3:41
-
Then this list stands as 3 reasons why I'm a moron. Works either way, I suppose. Thanks for the link!Eric– Eric2009年07月20日 04:31:22 +00:00Commented Jul 20, 2009 at 4:31
-
You do mean 3 more ways you are a moron, right?Brad Gilbert– Brad Gilbert2009年07月20日 04:44:13 +00:00Commented Jul 20, 2009 at 4:44
-
@Brad: Absolutely. The list is truly innumerable. If I were to ask my wife, I'm sure I could get an exhaustive list, though. May take a while.Eric– Eric2009年07月20日 05:02:15 +00:00Commented Jul 20, 2009 at 5:02
-
Although I agree with you, but you don't seem to answer my question: I was asking whether SO is still using LINQ to SQL, given that it has already drop out of MS priority.Graviton– Graviton2009年07月20日 06:12:38 +00:00Commented Jul 20, 2009 at 6:12
-
@Eric: I think that you were partially right though - I think Jeff mentioned on the podcast that there were some queries that LINQ couldn't generate, and that he was using SQL by hand for them, including the full text search.2009年07月20日 06:24:32 +00:00Commented Jul 20, 2009 at 6:24