locked
SQL Azure app direct access or via web service? RRS feed

  • Question

  • We are going to have several apps (.NET 3.5 windows forms, .NET 3.5 ASP.NET, VB6) connect to a database inside SQL Azure doing simple T-SQL DML operations (Insert, update, delete, select). The apps will run from different geographical locations (though can connect to any one datacenter in the US). 

    Following are the techniques I know of on how to achieve above:

    1. Using ADO.NET/OLEDB.NET/SQL Data Provider connect directly to the SQL Azure database over the internet.

    2. Inside Windows Azure create a web role of sorts that proxies between the SQL Azure and Apps. More like web services architecture.

    What is the recommended way? Is SQL Azure designed to work in the model #1 ?

    Thanks for your input.

    Thursday, December 15, 2011 2:26 PM

Answers

  • model 1, you will have to have the ip ranges of the clients to allow them access to your sql azure. your client apps needs to know the logins for your sql azure db as well.

    model 2, your client dont even need to know where the db is. you can easily scale it. even enable caching.

    i prefer #2.

    • Marked as answer by Challen Fu Monday, December 26, 2011 2:16 PM
    Thursday, December 15, 2011 2:41 PM
    Answerer
  • if you're fine opening the entire range. for me the firewall setting is valuable security feature and is there for a reason :)
    • Marked as answer by Challen Fu Monday, December 26, 2011 2:17 PM
    Thursday, December 15, 2011 3:08 PM
    Answerer

All replies

  • model 1, you will have to have the ip ranges of the clients to allow them access to your sql azure. your client apps needs to know the logins for your sql azure db as well.

    model 2, your client dont even need to know where the db is. you can easily scale it. even enable caching.

    i prefer #2.

    • Marked as answer by Challen Fu Monday, December 26, 2011 2:16 PM
    Thursday, December 15, 2011 2:41 PM
    Answerer
  •  

    Thanks for the response JuneT.

    For model 1 does not sql azure have a firewall setting that can be set to 0.0.0.0 so anyone will be able to access?

     

    Thursday, December 15, 2011 2:45 PM
  • if you're fine opening the entire range. for me the firewall setting is valuable security feature and is there for a reason :)
    • Marked as answer by Challen Fu Monday, December 26, 2011 2:17 PM
    Thursday, December 15, 2011 3:08 PM
    Answerer
  • The recommended is direct but don't forget to implement a retry policy, usually apps aren't expecting connection failures.
    Thursday, December 15, 2011 3:29 PM