I have been working on a Windows 8 app for a while. Given that creating a Metro Style app is new territory for us, there has been a bit of a learning curve along the way. One place this was especially true was when I started dealing with SQL queries. Prior to this project, I had certainly encountered SQL in web design, but I had never needed to create my own database or write any code that accessed the database itself. I recognized the importance of SQL, however, so when I first became an intern at Entrance Software I listed SQL programming as a skill I’d like to learn.
You may remember my blog post about IndexedDB, and you may be wondering what happened to my excitement about it. Well, I was very happy with my implementation of IndexedDB in my app: collecting data was fast and mostly easy, and it definitely improved the app overall. However, I had a single problem: IndexedDB required that the app fill the database at least once, and that process took far too long for the dataset I was working for. IndexedDB is still very useful, but only if you plan to store data locally and build it up slowly. I began to look into SQL as a replacement.
Luckily, Microsoft annouced Azure Mobile Services at around the same time and saved me a lot of trouble. Instead of having to learn how to create my own web service (a skill I still hope to gain eventually), I was able to use Microsoft’s on a free trial basis. Also luckily, Azure Mobile Services was released for Windows 8 apps only at the time. Needless to say, I quickly signed up.
Azure Mobile Services is very easy to set up and use, but it’s not quite SQL. You do build queries in order to access your data, although the options are limited (there’s no “GROUP BY” equivalent yet, as I sadly discovered today). The speed is definitely there, as well as the flexibility of a SQL database structure, but it’s not quite as robust as pure SQL code.
Given the nature of my data set, I still had to parse text files into a local SQL database first, then export the resulting tables to Azure. I had to learn multiple tricks to get the right data in the right spot, with the right structure and constraints. While it didn’t do all the work for me, I was able to get a lot of advanced SQL work done with a beginner’s knowledge, and within a few days I actually did have a working knowledge of SQL.
We will have a live example available of the Windows 8 app that I created for you to check out in a few weeks. In the meantime, check out some of our other posts discussing why you would create a Metro style app for enterprise situations.