SQL Azure vs. WCF Performance

I have seen many Azure performance tests, but I am wondering if anyone knows which of the following scenarios works best for a thick client application.

  • Connects to WCF services to access data that runs in the cloud and connects to a local SQL database. For example, let's say it's a WCF data service with an Entity Framework base model that connects to an Azure SQL database.

  • Connects directly to the SQL Azure instance from the client. For example, let's say the same queries and Entity Framework model as above, but connect directly to the Azure SQL instance, and not through the WCF data service.

Thanks.

+4
source share
3 answers

I definitely recommend you go with WCF + SQL Azure

One of the main ideas of SOA is to create short, not chat interfaces. This is especially true when placed in the cloud, because your client is not close to the data.

If you have complex business objects to populate, you may need to complete several queries. Using WCF services to communicate with SQL Azure, you can run all these queries in the Azure environment and minimize the number of trips on the Internet.

Of course, it costs more to do it this way, but it scales better because the level of service can be scaled.

There are a number of great advantages to this.

  • Separation between the client and the database (the data structure can be updated without changing the client).
  • As a corollary 1, if you need to outline the database, you can.
  • If you need to upgrade later to SQL Azure Federations (When this happens), you can.
  • You have an easy hook if you want to use Azure Caching.
  • Security (1) Your database remains behind the firewall.
  • Security (2) You can authenticate every request, not just a connection.
  • Security (3) If you are dealing with a document repository / blob, you do not need to make the keys of the repository account available to the client.

I manage many large enough tiered systems with your back-end WCF + SQL Azure architecture, and it works fantastically well.

SQL Azure itself works well over the network to the point that I'm even happy to run Dev databases in azure mode, but I don't think it's a good choice for a production application.

Hope this helps.

+3
source

I did not do the tests myself if we look at it logically.

You ask what is faster than SQL Azure(S) + Entity Framework (EF) + WCF or S + EF .

If we assume that the data transferred from the cloud in the form of query parameters and result sets are approximately the same size (which is likely to exist if the WCF service does not use SOAP or another XML format, in which case WCF will definitely transfer more data), then only the difference between the two scenarios is the WCF processing in the middle. Although this message is usually quite small, it is not zero, so a direct approach should be faster.

Unrelated to speed, I don't think it would be wise to create a web / worker role just to host this WCF service. For a 10 GB database, you would more than double the cost of hosting the database and add a level of complexity that doesn't seem warranted.

If you already have a role that makes sense to host WCF, this might make sense from a design point of view, and I don't think it has affected the performance too much (depending on the transport and security method used).

+1
source

There are several aspects:

  • Performance
  • Cost
  • Security

In Performance mode, your first option has an extra jump, so it will be slower. But if you have a really complex query, the difference between them will be very small compared to the total time.

On The cost of your first option will require an additional instance to run WCF services, hence the high cost.

In the "Security" section, the second parameter opens the port in the database from the Internet, so it is less secure.

+1
source

All Articles