Johan Åhlén

Johan Åhlén's blog about life, universe and everything.

December 2009 - Posts

Innovation - why companies need skunks

Do you have any skunks in your organisation? You should be happy if you have! Former CEO of Ericsson, Sven-Christer Nilsson, writes in his book that all great successes within Ericsson (like IP-telephony and mobile phones) have originated from persons that were not accepted by the management. This is not unique for Ericsson. There are a multitude of examples within other large companies. Skunk work, the things that employees do while the management looks away, can obviously be the most important work at the companies.

It seems to be a current trend that companies claim they are innovative, but few truly are. Google is one of few companies that seem to have understood innovation. At Google employees have a day a week for free work (skunk work!). Another thing is their rewards, so that nobody should have to leave Google because they have a great idea. A waste of time and money? No, their best ideas and products have actually evolved from those free work days. It's a matter of freedom combined with responsibility, and they keep the people that have a passion for their ideas.

I can really also recommend the book "The Future of Management" by Gary Hamel, where the author does a good job of explaining innovation (especially management innovation) and why innovation is not just a job for R&D departments. It should be mandatory reading for all management consultants working with Corporate Performance Management / Business Intelligence. One of the main points of the book is that most companies focus on operational efficiency at the expense of strategic efficiency, missing the most valuable business opportunities.

"This doesn't apply to my company" or "my company is a consulting only company, so there is nothing to improve" are comments I have heard from people stuck in the old thinking. I can give a good example of a consulting company organised in a new innovative way, but that will be in another blog post

Einstein said once that "We can't solve problems by using the same kind of thinking we used when we created them." I think that is why Apple encourages people to call someone they haven't talked to for 6 months. Why don't you do the same?

More reading

 

SQL Azure - some tips & tricks

In this blog post I'd like to share some of my experience working with SQL Azure so far. First a background on what SQL Azure really is and then I will give you some of my tips and tricks.

What is SQL Azure

Microsoft SQL Azure Database is a cloud-based relational database service that works much like an ordinary stand-alone instance of Microsoft SQL Server. It support most of the functionality in the SQL Server 2008 relational database engine, including SQLCLR support. It doesn't have the Business Intelligence components like Integration Services, Analysis Services, Reporting Services. Also it doesn't support typical DBA features, but that's logical since the whole idea of SQL Azure is that you should not need any DBA. Microsoft promises a 99.9% availability during a calendar month.

Currently SQL Azure is free to evaluate if you have an invitation. In production, the pricing will be a fixed cost per month which depends on edition and a data transfer cost. The web edition is limited to 1 GB database size and currently costs $9.99 / month. The business edition allows up to 10 GB database size and costs $99.99 / month. SQLCLR is supported only by the business edition. Data transfer costs is dependent on location, but costs less than a dollar per gigabyte.

Below is a screenshot from the SQL Azure management web site. There you create your databases and configure your firewall settings. This web site is located at http://sql.azure.com/.

 

Connecting to SQL Azure

Once you have created your SQL Azure databases, you need to enable access to the in the firewall settings. After doing that and waiting a couple of minutes for the changes to take effect, you can connect to your database. You can click on the Connection Strings button to get the necessary information to connect.

Previously there was no support for any graphical user interface to SQL Azure. When I started looking at SQL Azure I used the SQLCMD command line utility to execute my SQL commands. Thankfully now you can download the November CTP of SQL Server 2008 R2 and from there connect to SQL Azure through SQL Server Management Studio.

Below is a screenshot of the connection dialog where I connect to my SQL Azure database. Only SQL Server Authentication is supported. You need to type in your login in the format username@server. Also it is a good idea to click on Options and on the Connection Properties tab select your desired database in the Connect to database drop down list.

 

Scripting

Typically you develop databases locally in SQL Server 2008 and then deploy the SQL Azure. As mentioned earlier, SQL Azure doesn't support typical DBA features like filegroups settings. That means you need to limit the scripting options when copying objects from a local SQL Server 2008 database to SQL Azure. Luckily there is a new settings in the November CTP of SQL Server 2008 R2 where you can choose database engine type in the Generate Scripts... wizard. See the screenshot below:

By setting "Script for the database engine type" to SQL Azure Database, you exclude the features that are not compatible with SQL Azure.

 

Copying data

If developing in a local SQL Server 2008 environment, you may want to copy data between your environment and SQL Azure. Basically there are two ways in Management Studio to do this.

Either you can use the Generate Scripts... wizard and through the Types of data to script option make it generate INSERT STATEMENTS for your data.

My preferred way however is to use the Import and Export data wizard. That wizard build an SSIS package in the background and executes to copy your data. It supports a variety of data sources like SSIS does.

The key to use the Import and Export data wizard is to use the right database provider. Currently it seems that SQL Azure only works with the .Net Framework Data Provider for SqlServer and not with the default provider suggested by the wizard. Below is a screenshot of my settings.

 

Encryption

Encryption is mandatory in all connections to SQL Azure. Usually you do not need to worry about it as it is automatically set by the server upon connecting.

 

Connection closing

The save resources, SQL Azure closes connections after they have been idle for some time. In Management Studio, this is not a big problem. You can just retry your queries. However it causes more problems in your applications.

Here is my theory what happens. By default, Windows and web applications use connection pooling to improve performance. Connection pooling means that connections are reused instead of being opened and closed. When your application closes a connection, it actually stays open in the connection pool. When it's been idle long enough it get's killed by SQL Azure. Guess what happens when your application tries to connect? Yes, it gets the save connection that's dead.

Your could either disable connection pooling or add try/catch error handling to retry your queries when they fail. I have successfully used the try/catch method to get rid of all problems. That should be the preferred method since disabling connection pooling would hurt your performance much more.

 

Collations

There is no way to set collation on database level. I've tried! Upon creation, the databases are set to SQL_LATIN1_GENERAL_CP1_CI_AS. For people like me who write applications in other languages than English, this is an annoyance.

What to do? The good news is that SQL Azure supports collations on column level even if I'd prefer a global setting on database level instead. Also you can do a collation cast in your queries, for example:

SELECT LastName
FROM MyTable
ORDER BY LastName COLLATE Finnish_Swedish_CI_AS ASC

 

Final words

The core of SQL Azure seems to be relatively complete, but it still lacks quite a bit in the user interface support. That makes it useful for experienced SQL Server users. However, I think there soon will be much better support from SQL Server 2008 R2 Management Studio.

SQL Azure is one of three cloud platforms from Microsoft. The other two are Windows Azure and the AppFabric. I've developed a Windows Azure application that uses my SQL Azure database. Doing that I missed the possibility to host them in the same Affinity Group. That should be a key requirement to get optimal performance from your cloud applications.

 

Posted: Dec 20 2009, 06:34 AM by jahlen | with 5 comment(s)
Filed under: , ,
Shed some light on your data with SilverLight

This week I've been experimenting some with SilverLight. It could be a really interesting combination with the Windows Azure platform. Or why not use for displaying real-time data streams from SQL Server StreamInsight?

Anyway I ended up doing a simple pool game simulator. Quite far away from my idea of visualising data, but I do things for fun. I've published the source code at CodePlex so you can see how it works. Making a realistic simulation of the balls physics is not trivial.

Maybe this could be made into a real game? Would be cool to have it communicate with the Azure platform, and not only something simple such as storing a high score-list.

Why SilverLight is interesting to me:

  • Good development tools - Visual Studio and Expression Blend
  • Support for WCF (Windows Communicatinos Foundation), SOAP, REST, etc makes data access and communications easy
  • Supported by most web browsers
  • Easy to accomplish things with a few lines of code

So why not use SilverLight to shed some light on your data?

Resources

Posted: Dec 04 2009, 04:06 PM by jahlen | with 1 comment(s)
Filed under: ,