Tuesday, 4 November 2008

Azure: Development Storage for those without SQL Express

So if you are like me and you don't have SQL Server Express Edition installed, you might have a couple of issues with the Development Storage in Windows Azure.

If you launch development storage you will get some error about SQL Express edition not being installed.

So how do you get around this

First of all you need to find your DevelopmentStorage.exe.config file, it's located in ("C:\Program Files\Windows Azure SDK\v1.0\bin")

Open it up in notepad or Visual Studio, and change the database server instance (2 places).  I've bolded where you need to change in the sample config below.

If you then start up your development storage all should be okay, once more.

<?xml version="1.0" encoding="utf-8" ?>
<
configuration>
  <
configSections>   
    <
sectionname="developmentStorageConfig" type="Microsoft.ServiceHosting.DevelopmentStorage.Utilities.DevelopmentStorageConfigurationHandler, DevelopmentStorage.Utilities"    />
  </
configSections>
 
  <
connectionStrings>
    <
addname="DevelopmentStorageDbConnectionString"
         connectionString="Data Source=.\SQL2008;Initial Catalog=DevelopmentStorageDb;Integrated Security=True"
         providerName="System.Data.SqlClient" />
  </
connectionStrings>
 
  <
appSettings>   
    <
addkey="ClientSettingsProvider.ServiceUri" value="" />
  </
appSettings>
 
  <
developmentStorageConfig>
    <
services>
      <
servicename="Blob"
               url="http://127.0.0.1:10000/"/>
      <
servicename="Queue"
               url="http://127.0.0.1:10001/"/>
      <
servicename="Table"
               url="http://127.0.0.1:10002/"
                     dbServer="localhost\SQL2008"/>
    
    </
services>
   
    <!--
NOTE: These are preconfigured accounts with well known keys. The purpose of the
      authentication supported by the development storage is simply to allow you to test
      your authentication code. It has no security purpose.
      It is strongly recommended that you DO NOT use your actual storage account or key over here.
      These keys are stored unencrpted on disk and in SQL databases.
    
-->
    <
accounts>
      <
accountname="devstoreaccount1"
               authKey="Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw=="
               isAdmin="false"
               contactInfo=""/>
    </
accounts>
  </
developmentStorageConfig>
   
  <!--
 
Use this section to configure logging of  requests and  responses from the development storage
  (http://msdn.microsoft.com/en-us/library/ty48b824.aspx).
 
  The logs go to %LOCALAPPDATA%\DevelopmentStorage\Logs and are named after the date/time when
  the development storage was started.
 
  The default logging level is Critical. You can change this to Information or Verbose for debugging.
 
-->
 
  <
system.diagnostics>
    <
sources>
      <
sourcename="System.Net.HttpListener" switchName="default" >
        <
listeners>
          <
addname="defaultListener"/>
        </
listeners>
      </
source>
    </
sources>
    <
switches>
      <
addname="default" value="Critical"/>
    </
switches>
    <
sharedListeners>
      <
addname="defaultListener"
           type="Microsoft.ServiceHosting.DevelopmentStorage.Utilities.CustomizedTextWriterTraceListener,DevelopmentStorage.Utilities"
      />
    </
sharedListeners>
    <
traceautoflush="true"/>
  </
system.diagnostics>
</
configuration>

Azure: DDD7 – Welcome to the Cloud

So I am working on a new session for DDD7 for which the title is “Welcome to the Cloud”, however you could read that title just as happily as “Welcome to Windows Azure”, or “Introduction to Windows Azure”.

So if you haven’t guessed already this session will be all about Windows Azure.

I hope to give a good introduction to Windows Azure and get you started developing on the platform / SDK.

Hope to see you there

Monday, 3 November 2008

Silverlight: Spectrum Emulator at PDC Show Off

I promise to stop going on about the Silverlight Spectrum Emulator.

However, I was very proud that it appeared in the PDC Show Off, it didn't win (there were much more worthy entries), however it was great to see it displayed.

You can see the video of the emulator on channel 9

Big thanks to Brian Keller and Dan Fernandez for hosting the event and showing the video

Silverlight: Spectrum Emulator is in the Community Gallery

I've noticed that my Silverlight 2 Spectrum Emulator is in the Community Gallery now :)

Windows Azure: Pricing Idle CPU Time

My past few blog posts have really been focused on developing against the pricing model of Azure.

I don't really want to be thinking about cost efficiency but I do believe in a world of Azure, developers will be very aware of the cost of an application.

Looking at the current azure metrics, it seems that the following will be monitored (and eventually billed, although not in the CTP timeframe).

  • CPU time, measured in CPU-hours
  • Bandwidth for ingress/egress from the data center, measured in GBs
  • Storage, measured in GBs
  • Transactions, measured as requests likes Gets & Puts
  • To be clear the CPU time measured INCLUDES IDLE TIME, whilst this makes lot of sense for the CTP, as essentially each instance of a role is equivalent to 1 VM (against 1 core).  It doesn't make sense beyond the CTP.  This is also the same model that Amazon uses with their EC2 cloud solution.  Unfortunately with this model with Amazon CPU time costs $90 per instance per month (which is pretty expensive).

    I hope Microsoft doesn't follow this model as this can be pretty expensive for the average developer.  However I do get the feeling that the one VM per role model (as used in the CTP) will not be the same model used when it goes production.

    Hopefully Microsoft will look at a model which will combine a cost of running an instance + a CPU Utilization cost.  This would give a low cost solution for developers with services with a low utilization, i.e. we don't really want to be paying for idle instances.

    Sunday, 2 November 2008

    Windows Azure: Cache based Session Providers????

    So following on from my previous article regarding cost efficient code reviews, I am going to predict a potential new session provider model.

    In a world of Windows Azure we will be making more decisions for our applications based on cost. Session is an obvious target as the current session model in ASP.NET could cost us a lot of money (depending on Microsoft's pricing model).

    Windows Azure, Cache and Velocity

    So at the moment the only cache provider available that can realistically be used with Azure is to use Windows Azure Storage's Table Storage Service. There is already an ASP.NET provider supplied in the Azure SDK, (technically you could use SQL Services but this would be more expensive and unnecessary).

    So Microsoft have said they plan to extend the options available for Windows Azure Storage Services and provide a Cache Service (based on Velocity).

    This is likely to be cheaper and faster than using the Table Storage Service. If it's not cheaper (or at least the same price), I suspect folks will continue to use the Table Storage Service. This is a really good thing and will mean that we can reduce our costs further when using caching with ASP.NET.

    Cache based Session Provider

    So assuming that the cache service is cheaper than the Table Storage Service, it is logical that Microsoft will provider a Session State provider that is based on the Cache Service. If Microsoft don't create such a provider, then I suspect someone else will.

    The reason I suspect this is that, if it's cheaper to use the Cache Service than to use the Table Service, it makes sense to utilize the service for what is considered as volatile data. It wouldn't be hard to build such a provider for the session.

    In a web application where session data is frequently read and written to, if costs can be reduced using an alternative model then it makes commercial sense to utilize this.

    I guess the only case that such a model wouldn't be explored is if the pricing of the Cache Service and the Table Service were the same.

    Silverlight and Session Providers

    This also brings an interesting question for your application and Silverlight, i.e. is exposing the session via web services to your silverlight application, the most cost efficient model. I will try and think about how this affects Silverlight also in future articles.

    Cost efficient development is definitely coming and these are the sort of areas that will be explored.

    Windows Azure - Cost Efficient Code Reviews

    So with the advent of Windows Azure, I see that companies will put more stress on Code Reviews.

    This is a great thing for companies in general as I do believe that not enough companies invest enough time in Code Reviews.

    So why do i believe that Windows Azure will invest more in Code Reviews? I believe this because without code reviews, badly written applications could cost companies a lot of money than a well written application

    Reviewing for Cost Efficiency

    I suspect a new set of best practices and patterns will emerge with the ultimate aim of keeping costs low for applications. I suspect we will also see the development of new tools which will allow you to simulate loads and predict the cost of applications.

    In order to keep cost efficiency companies will require team leads to review code with a particular emphasis on cost.

    Code Reviews will be looking for:

    • Unnecessary use of SQL Services (which has a higher cost than Windows Azure Storage)
    • Appropriate use of caching (rather than just retrieving from the storage area blindly)
    • etc, etc

    Session State Example

    A good example of where you can use unnecessary costs in a web application is the session state.

    An ASP.NET application on each HTTP Request will retrieve the session for the current user. In a normal world this is not a big deal because we have already paid for our session state. I say we have already paid for our session state, as we either have an inprocess session, or a sql server session. There is no real cost for maintaining our session, the infrastructure is already there. We have paid for our SQL Database and we tend not to be charged by hosting companies for internal network bandwidth usage.

    In a world of Azure we cannot use InSession providers, because we cannot rely that requests will always be serviced by the same server / VM. Therefore we must keep session in Windows Azure storage (you could keep it in SQL Services but that would just frankly be frivolous). This is the only way (at present) we can guarantee to keep our session data with scale.

    The downside is that everytime we retrieve data from the session, it's costing us money (Microsoft has not released its pricing model, so we don't know how much yet). So we therefore we have a few considerations?

    Does the page in question use the session?

    If not switch it off for that page, this is a performance best practice anyways but one which is generally ignored. If you switch off the session for that page then you are potentially saving yourself bandwidth, storage, CPU costs (depending on Microsoft's pricing model).

    Is it appropriate to keep the data in the session?

    Lets say there is a piece of data that is potentially accessed by the user in the course of a session but it may or not be used? Is it appropriate to keep that bit of data in the session (especially if it's quite large)? To be honest that question that sort of question is still valid for todays applications but with a utilization cost model, it massively increases the importance of such questions?

    Conclusion

    Anyways this is just my rambling as I am sitting in an airport in Los Angeles, however i think these sort of questions will become very important in a world of Windows Azure.

    Developers be prepared to optimize applications not just for performance but now for cost.

    It will be interesting to see the guidelines, best practices and tools that get developed in this area.