Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LINQ to SQL with SQL Azure

We are investigating moving to a cloud model and the Microsoft Azure PaaS platform.

Our current data layer is written using LINQ to SQL. Will it be compatible with SQL Azure?

like image 264
laconicdev Avatar asked Aug 27 '12 13:08

laconicdev


People also ask

Is LINQ converted to SQL?

LINQ to SQL translates the queries you write into equivalent SQL queries and sends them to the server for processing. More specifically, your application uses the LINQ to SQL API to request query execution. The LINQ to SQL provider then transforms the query into SQL text and delegates execution to the ADO provider.

Is LINQ to SQL still used?

LINQ to SQL was the first object-relational mapping technology released by Microsoft. It works well in basic scenarios and continues to be supported in Visual Studio, but it's no longer under active development.

How does LINQ work with SQL?

In LINQ to SQL, the data model of a relational database is mapped to an object model expressed in the programming language of the developer. When the application runs, LINQ to SQL translates into SQL the language-integrated queries in the object model and sends them to the database for execution.


1 Answers

Yes LINQ to SQL is compatible. But you have to keep 2 things in mind:

  • SQL Azure is not a dedicated machine for you alone. Your databases will run on machines with other customers. You may be throttled, you can encounter transient exceptions, ... That's why you should implement a retry policy. There's an article on TechNet explaining how to do this with LINQ to SQL.
  • Since SQL Azure is not a real SQL Server there are some limitations. Read all about those limitations here: General Guidelines and Limitations (Windows Azure SQL Database). If you're planning to move an existing database (with or without data) to SQL Azure, consider using a tool that supports SQL Azure like the SQL Database Migration Wizard (SQLAzureMW).
like image 91
Sandrino Di Mattia Avatar answered Sep 29 '22 11:09

Sandrino Di Mattia