Is SQL Azure suitable for Desktop client applications - wpf

I have a client that runs a small business. They need a custom database solution and I'm looking into various options. My experience is limited to .NET using local SQL Servers (no ASP.NET), however, this client is non-technical and would benefit from being able to outsource the DBA tasks. I'm a complete Azure noob, I just scanned the tutorials and they all appear targeted at developing MVC ASP solutions. The client doesn't need a browser based solution. A fat desktop client used from different geographical offices would be the least expensive option I can deliver. I'm just trying to save some time going through all the tutorials and docs only to find out that this isn't what SQL Azure is intended to do. In effect my questions boil down to:
Can I develop a C#/.NET WPF desktop application using Entity Framework 4 and have it hit SQL Azure instead of a local SQL Server?
Are there any known gotchas with EF4 and SQL Azure?
Are there other hidden development costs/complications in using SQL-Azure instead of a local SQL Server.
Is the basic tool support the same? One specific example I can think of; do I get a SQL profiler tool for troubleshooting?
The final question is security related and I'm not sophisticated enough to ask a good question, but is hitting a SQL Azure db this way considered a security no no?

Yes, you can, but a more suitable approach would be to use WCF Data Services or another form of web services (asmx or WCF) as a services layer for your application. I like this approach for line of business applications. I hate web apps for line of business and by using a services connected WPF desktop application, you get the benefits of running in the cloud and having a cloud offering without the necessity to be HTML based.
SQL Azure has full support for EF these days. In the past there were some issues, but I have not encountered any these days.
In terms of development costs and complications - the Azure desktop hosted environment is a bit of a PITA from a development perspective, but I haven't had major problems. You lose the ability to share a local DEV SQL Server unless you use a hosted instance....of course there's a development cost in that because you have to pay for usage.
Good point! SQL Azure does not provide SQL Profiler support at present. I personally use the built in EF tracing support for this functionality.
Exposing a SQL Azure DB directly isn't a good idea from a security perspective. That's why I suggest hitting a WCF Data Services (or other web services) endpoint in point 1.

You can develop a desktop or on-premise application that uses SQL Azure for your database.
You need to take the standard Azure precautions - assume that connection failures will occur and ensure that your application has retry logic to restore operation. Also note that SQL Azure will terminate any operations that take longer than a minute, to preserve the service for other users. If you have lots of data and some nasty queries, that might be relevant.
EF works fine with SQL Azure. There are some limitations to SQL Azure, itself, which you can read about from the documentation on Microsoft's web site. If you design you database for Azure, it'll work fine on SQL Server or SQL Express (but not necessarily the other way around).
In addition to the monthly charge for the database, you will pay for data that leaves the data centre. Design your application carefully to minimise the amount of data that is retrieved from the database. You no longer have to pay for data going into the data centre, which helps.
You can still use SQL Management Studio and Data Connections within Visual Studio. No SQL Profiler, though. There are a few irritating things you can't do with Management Studio, but nothing insurmountable.
You will have to open up firewall rules for access to the database, but hopefully, they'll be limited. Authentication is by SQL Server credentials, not integrated authentication.
I wouldn't tend to do it this way, but it works.

Related

sql azure reporting solutions

Here's my setup:
SQL Azure DB - This is the PaaS solution, not SQL Server running on an Azure VM.
Single Page App (Angular.js) hosted on Azure Web App.
My needs:
I'd like to find a packaged solution where we could allow user-configured reporting that could be saved by the user, for running later. Output would ideally be either CSV or PDF.
Initial thoughts:
Could we create a SQL Server installation on an Azure VM, and use SSRS with the SQL Azure DB as the data source?
Are there third party solutions that could meet these needs?
My research so far has shown one answer... migrate your data to SQL Server running on Azure VM, and use SSRS that way.
Any additional suggestions? I'm reluctant to do a data migration if I can avoid it.
Consider PowerBi, there are numerous examples on the web and here is an overview. What you basically get is an excel-like environment with a lot of smart and easy visualizations. I am not sure how well it works, but there is a possibility to ask questions about your data in natural language as well.
It should be pretty easy to connect your database to PowerBi, then your user can configure what kind of visualizations/report does he want to have.

How to password protect database that is created using Entity Framework Code First?

The title says it all: as we are nearing release of our desktop application, which uses a local database (SQLServer 2014 LocalDb), we want to password protect access to it.
The database will be created using EF Code First on the user's computer the first time he starts up the application.
This must be really simple, but I seem to overlook the solutions that should present itself on Google.
The short answer here is you can't password protect LocalDb. LocalDb is designed to be a low friction database setup for development and testing, but it does not provide any of the advanced features of SQL or even SQL Compact Edition. From MSDN:
LocalDB is created specifically for developers. It is very easy to install and requires no management
and then there is this:
Moreover, if the simplicity (and limitations) of LocalDB fit the needs of the target application environment, developers can continue using it in production, as LocalDB makes a pretty good embedded database too
"pretty good" implies that while it will work, there may be better solutions. Essentially, the lack of security is a feature of LocalDB. It is designed to run as the currently logged in user, giving them full access.
If you need Database Security as a feature of your deployed application, but do not want to deal with the complexities of a full SQL installation, you should consider SQL Compact Edition.
See this article How to: Deploy a SQL Server Compact 4.0 Database with an Application. Deployment will vary depending on the deployment methods used by the rest of your application.
Entity Framework is an abstraction layer which is not specifically tied to a specific database technology. It will work identically with LocalDb, SQL Compact, SQL Express, MySQL, postgresql, etc... usually with nothing more than than the correct database driver and the correct connection string supplied.

Move database from MSSQL server to Cloud Storage

My company's product has a big relational database storage(around 20 TB) and we want to move all or some part of our database. Now I am a bit confused regarding which cloud SQL service will be suitable for me. I have read that some cloud storage only provides specific SQLs like MySQL ... which I cannot afford, the reason is that here we have lots of Transact-SQL scripts on our MSSQL server, which periodically updates the data.
So what should be my basic approach to achieve that, How can I compare between various cloud-based relational database storage like Google Cloud SQL, Azure SQL and Amazon RDS?
If your existing SQL server is Microsoft SQL Server then it probably makes the most sense to use a Microsoft SQL server offering in a cloud environment. That will help minimize any sorts of compatibility issues and also minimize the need to learn a new SQL server environment.
Amazon's RDS service lets you choose between various versions of MySQL, Postgres, Oracle, and Microsoft SQL Server. With regards to Microsoft SQL Server, Amazon offers an express edition, as well as SE and EE versions. As far as licensing goes, they offer both "bring your own" as well as pay-by-usage licenses. More information on the license details can be found in their RDS documentation. They also have a usage calculator that lets you estimate what your monthly costs will be based on the license you use, the size of the instance, etc.
Since Azure SQL is a Microsoft product I would hope that it's compatible with Microsoft SQL Server but I have never used it so I honestly have no idea if there are any compatibility issues. Microsoft also has some basic pricing information available for Azure SQL so you can work out an estimate of your costs if you go with them.
If you're concerned about any scripts working properly on one of the cloud platforms then I'd suggest creating a small test database that you can thoroughly test those scripts with. Upload that test database to the different clouds and test the scripts there to ensure they function properly. Amazon offers a very light-weight RDS instance for free so you can do basic testing without it costing you anything. Perhaps Azure offers something similar. Even if they don't or the free RDS instance isn't powerful enough for your testing needs, spinning up an instance for a day or two to run these sorts of tests shouldn't cost you very much.

Standalone Database Option that works well with EF and is easily deployable?

I recently started a Winforms VB.NET application that uses a mysql database to store information. Problem is this is a standalone system no network access to the database is needed. And installing mysql server, along with the connector has become a great burden. Is there a viable alternative database engine that will be non-transactional, and EF still works with. This database just needs to keep up with client details, payment History, and related items..
SQL Server Compact might work for you, depending on it's limitations. If not, SQL Server Express will work fine

Best practice for running SQL Server reporting services. Should I run on the database or web server?

I am configuring a new environment to run several intranet web applications. I have 2 servers, one will be the SQL Server 2008 server, and the other will be the IIS server. I also need to install SQL Server Reporting Services. I am not sure whether it would be better to run reporting services on the database server, or web server. Is there a best practice for this situation?
Depends...
The reporting services rendering is fairly processor intensive so you need to keep that in mind. Typically if I'm designing a system with heavy load or throughput requirements I place the reporting services instance on its own server. The best practice is really dependent on the complexity of your system.
If a third server is not an option and the two servers you already have are similarly speced I would probably place it on the one with the lowest processor load. If you place the reporting server on the web server make sure that Reporting services uses your dedicated database server for the reporting services meta-data so that you don't have to install the RDBMS on both machines.
You need to keep in mind that if you don't place the reporting server on the same box as SQL server you will need another SQL Server license. The product is only "free" if it is installed on the same machine as SQL.
I would run installer on your web server so that the web service components of Reporting Services are installed there.
It is also benificial to configure reporting services with it's own application domain in IIS so that you can tweak the configurations independant of say your other web applications.
When you run through setup using the Reporting Services Configuration Tool, set up the database on your non web server (i.e. dedicated db server). This way all your data processing is handled on one server and all your web processing/data rendering is handled on another.
Hope this is clear and of use but please feel free to pose further questions.
Cheers,John

Resources