<p>There are so many different options coming out of microsoft for data access. Which one is the best for scalable apps?</p>

<p><strong>Linq</strong></p>

<p>Should we be using Linq? It certainly seems easy but if you know your SQL does it really help. Also I hear that you can't run Async queries in ASP.NET using Linq. Therefore I wonder if it is really scalable? Are there any really big sites using Linq (With the possible exception of stackoverflow).</p>

<p><strong>Entity Framework</strong></p>

<p>Don't hear so much razzmatazz about the Entity Framework. Seems closer to the Object model I'm familure with. </p>

<p><strong>Astoria/Dynamic Data</strong></p>

<p>Should we be exposing our data as a service?</p>

<p>I'm pretty confused and thats before I get into the other ORM products like NHibernate. Any ideas or wisdom on which is better?</p>

[{'answer_id': 67852, 'author': 'Gulzar Nazim', 'author_id': 4337, 'author_profile': 'https://Stackoverflow.com/users/4337', 'pm_score': 4, 'selected': False, 'text': '<p>I think ADO.Net Data Services (formerly called Astoria) has a huge role to play. It fits nicely with the REST style architecture of the web. </p>\n\n<p>Since web is scalable, I guess anything which follows its architecure is scalable too..\nAlso, you might want to keep a lookout for SQL Server Data Services..</p>\n'}, {'answer_id': 67854, 'author': 'foxxtrot', 'author_id': 10369, 'author_profile': 'https://Stackoverflow.com/users/10369', 'pm_score': 1, 'selected': False, 'text': "<p>Use whatever works for you. These are all easiest to set up if you already have a fairly normalized database (ie, good definition of primary keys and foreign keys). However, if you've got data that doesn't easily normalize, the Entity Framework is more flexible than LINQ to SQL, but it does take more work to configure.</p>\n"}, {'answer_id': 67866, 'author': 'Guy', 'author_id': 1463, 'author_profile': 'https://Stackoverflow.com/users/1463', 'pm_score': 1, 'selected': False, 'text': "<p>We've been experimenting with LINQ in a clustered environment and it appears to be scaling well on the individual machines and across the cluster. Of the 3 options that you've provided I would say that LINQ is the better choice although each option has a slightly different target audience so you should define what you will be doing with the data before deciding on the acesss paradigm.</p>\n"}, {'answer_id': 67867, 'author': 'Eric Z Beard', 'author_id': 1219, 'author_profile': 'https://Stackoverflow.com/users/1219', 'pm_score': 2, 'selected': False, 'text': '<p>If you are talking about relational databases, then my vote is for encapsulating all of your data operations in stored procedures, regardless of how you access them from the other layers.</p>\n\n<p>If you disable all read/write access to the database, except via stored procedures, you can hide your data model behind well defined contracts.  The data model is free to change, just so the stored procedures still honor their inputs and outputs.</p>\n\n<p>This gives DBAs total freedom to tune your application and make it scale.  This is a very, very difficult task when SQL is being generated by a tool outside of the database.</p>\n'}, {'answer_id': 68173, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 1, 'selected': False, 'text': '<p>I would suggest linq. It scales well on our site and is simple enough to use.</p>\n'}, {'answer_id': 68226, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 1, 'selected': False, 'text': "<p>use stored procedures with LINQ...but don't let the sprocs turn into a data access layer!</p>\n"}, {'answer_id': 69307, 'author': 'Scott Hanselman', 'author_id': 6380, 'author_profile': 'https://Stackoverflow.com/users/6380', 'pm_score': 5, 'selected': True, 'text': "<p>I would recommend either NHibernate or Entity Framework. For large sites, I'd use ADO.NET Data Services. I wouldn't do anything large with LINQ to SQL. I think Stack Overflow might end up with some interesting scale problems being 2-tier rather than 3-tier, and they'll also have some trouble refactoring as the physical aspects of the database change and those changes ripple throughout the code. Just a thought.</p>\n"}, {'answer_id': 80035, 'author': 'MotoWilliams', 'author_id': 2730, 'author_profile': 'https://Stackoverflow.com/users/2730', 'pm_score': 2, 'selected': False, 'text': '<p>Locking into stored procedures seems to be a waning way of thought these days, at least that have been my current observations. That way of thinking does lend itself to the ORM world since they are typically more affective going against tables directly but any ORM worth their salt will also allow the use of procs – sometime you have no choice.</p>\n\n<p>There is plenty of opinions around EF and regardless of what anyone says, good or bad, it is a V1 product and with the rule of thumb that MS takes about 3 revs to get it right it might be prudent to wait for the next rev at least.</p>\n\n<p>It seems that the biggest player out there in this space is NHibernate and there is plenty of support for this in the community.  Linq, the language feature, shouldn’t be too far off in making its way to the NHibernate stack.</p>\n'}, {'answer_id': 42689609, 'author': 'ScottK', 'author_id': 6693299, 'author_profile': 'https://Stackoverflow.com/users/6693299', 'pm_score': 0, 'selected': False, 'text': '<p>This post is from 2008 before the cloud really took off. It seems like an update to the answer is required. I will just provide some links and an overview. I am sure that there are more up-to-date posts at this site on this topic, and if I find them, then I will add the links here.</p>\n\n<p>When it comes to data scalability and transaction processing scalability, in 2017 we need to be talk about the Cloud and Cloud Service Providers. </p>\n\n<p>I think the top three Cloud Providers these days are: </p>\n\n<ul>\n<li><a href="https://aws.amazon.com/pricing/" rel="nofollow noreferrer">Amazon Web Services (AWS)</a></li>\n<li><a href="https://cloud.google.com/pricing/" rel="nofollow noreferrer">Google\'s Cloud Platform (GCP)</a></li>\n<li><a href="https://azure.microsoft.com/en-us/pricing/" rel="nofollow noreferrer">Microsoft Azure</a></li>\n</ul>\n\n<p><strong>Cost</strong></p>\n\n<p>One of the great thing about using cloud services is that there are no upfront costs, no termination fees, and you pay only for what you use. (Quoting Mr.Alba\'s 2016 article "<a href="https://www.sitepoint.com/a-side-by-side-comparison-of-aws-google-cloud-and-azure/" rel="nofollow noreferrer">A Side-by-Side Comparison of AWS, Google Cloud and Azure</a>")</p>\n\n<p>We use AWS ourselves. We pay only while we have VMs installed and running, so it can be a cheap way to start up. Typically, service providers charge by the minute or by the hour but you are guaranteed to have it for that entire time. </p>\n\n<p>A cheaper way to go is best-effort spot pricing. The Spot price represents the price above which you have to bid to guarantee that a single Spot request is fulfilled. When your bid price is above the Spot price, Amazon EC2 launches your Spot instance, and when the Spot price rises above your bid price, Amazon EC2 terminates your Spot instance. (Shamelessly quoting Amazon\'s User Guide <a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-spot-instances-history.html" rel="nofollow noreferrer">here</a>) </p>\n\n<p><a href="https://www.sitepoint.com/a-side-by-side-comparison-of-aws-google-cloud-and-azure/" rel="nofollow noreferrer"><em>A Side-by-Side Comparison of AWS, Google Cloud and Azure</em></a> is a good article doing a side-by-side comparison of these three service providers available <a href="https://www.sitepoint.com/a-side-by-side-comparison-of-aws-google-cloud-and-azure/" rel="nofollow noreferrer">here</a>. </p>\n\n<p>For a more academic look at cloud services, read the 2010 paper by Yu, Wang, Ren, and Lou "<a href="http://ieeexplore.ieee.org/document/5462174/" rel="nofollow noreferrer"><em>Achieving Secure, Scalable, and Fine-grained Data Access Control in Cloud Computing</em>"</a> in the INFOCOM 2010 Proceedings available <a href="http://ieeexplore.ieee.org/document/5462174/" rel="nofollow noreferrer">here</a>, but you may need to be an IEEE member to gain access to it. While it is somewhat dated, it is excellent and you can use it as a jumping off point.  </p>\n\n<p>Scaling in the cloud has been exploding, and until recently that scaling was done by starting up new Virtual Machines which tooks seconds, but with Containers one can spin up new instances in milliseconds. For more information on this, check out Docker and Docker Containers <a href="https://www.docker.com/what-docker" rel="nofollow noreferrer">here</a>.</p>\n\n<p>I apologize for this answer being just a bunch of links for more information, but I thought the answer to this question should have an update. I hope this inspires someone to provide more first hand details. If you have already posted some related information, please consider providing links to your own posts. Thanks!</p>\n'}]
['https://Stackoverflow.com/questions/67831', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/6336/']