Sunday, August 24, 2014

Take the #icebucketchallenge!

Today, I answered my daughter Katy’s ice bucket challenge and am donating to ALS! I also challenged three more people. You now have 24 hours to answer the challenge!

#icebucketchallenge

Saturday, August 23, 2014

Solar Energy That Doesn’t Block the View

I’m really getting excited about the innovations going on in green technologies. This article on see-through solar panels is pretty interesting to me. Combined with solar roadways, we are really on the brink of a revolution in our energy generation capabilities.

From the article, “It is called a transparent luminescent solar concentrator and can be used on buildings, cell phones and any other device that has a clear surface.”

For more info, check out the article:

Michigan State University. "Solar energy that doesn't block the view." ScienceDaily. ScienceDaily, 19 August 2014. <www.sciencedaily.com/releases/2014/08/140819200219.htm>

Monday, August 18, 2014

Microsoft Azure Stumbles - Again

I recently wrote about being “In Search of a Highly Available Persistence Solution”. However, it seems that Azure has been experiencing other more sweeping outages and service degradations. PCWorld recently wrote about Microsoft’s woes, “Azure cloud services have a rough week”.

Today, we are nervously watching as the service issues continue. Luckily the outages have not affected our product … yet.

azure-status

Microsoft is trying very hard to gain ground against rival Amazon. This certainly doesn’t help. To be fair, cloud outages are not uncommon and when they do occur, a lot of people get pissed off. Last year’s InfoWorld article shows that it happens to the best of them.

Monday, August 11, 2014

Microsoft Released Visual Studio Update 3 – Aug 4, 2014

Microsoft released Update 3 to Visual Studio last week. Below is a list of what’s new:

What's new in Visual Studio 2013 Update 3

Click here for a link to the release notes.

In Search of a Highly Available Persistence Solution

Our cloud-based SaaS offerings are hosted in Azure. Like many applications, some of our apps began life in the era before cloud computing became mainstream. As a result many design decisions had to be rethought. Some involved some rather extreme makeovers just to be able to run there – like removal of CLR stored procedures (gah!) since SQL Azure didn’t support it. Others were more fundamental to multi-tenant apps, but required change nonetheless.

Along the way, we have made numerous changes that brought higher performance, stability, scalability and reliability to the products. Frankly, the Azure compute infrastructure for PaaS is excellent. Combined with Windows Azure Traffic Manager our compute has performed admirably. Scaling is a snap. Deployment is beyond easy. Then we hit the snag. Persistence. State sucks. Compute is easy because it can be treated statelessly; but the persistence layer is another story. If your database goes belly up, you’re dead. Having an offline copy of your database could help, right? But then you think, “How recently did you make that copy?” Or, “What about data loss between backups? My user really wants to see that last transaction!” And once your original database is back online, you ask yourself, “How do you sync up the changes?” Wouldn’t it be great if that copy was a transactionally-consistent copy?

SQL Azure touts high availability in the datacenter through its replicas. Every database is actually implemented as a master and two replicas. Their stated goal is 99.9% availability. On paper, you might think that having two replicas of your data would be sufficient to give you high availability. Our experience is that it is not. They do not offer a cross-datacenter high availability option. In recent conversations with Microsoft, surprisingly they are pointing people towards SQL Server in IaaS for high availability. Their Tutorial: Database Mirroring for High Availability in Azure further supports this view. C’mon guys – you can do better than this! This is a cop out. I want a scalable, highly available, cloud-ready repository.

Edit: The new database SKUs for Azure SQL Database (basic, standard, and premium) maintain “at least three replicas”. Please refer to this overview of the new SKUs for more information. I want to point out that our current product deployments are using the GA SKUs (Web and Business) and not the new SKUs outlined in this overview.

Time for another design check. In reality, what your application must do to get closer to the magical 5 9’s of availability is to move replication logic into the application. If you’re contemplating more than one form of persistence (we are) and if you want high availability (we do), then be prepared to roll your own. A number of architectural design sessions and a review of the options available to the Azure ecosystem makes it clear that they don’t have a complete answer here. It’s not entirely surprising. They give you the primitive infrastructure and framework bits and you do the rest. In this case the platform affords you nothing leaving you to do the rest a.k.a. everything else…

Moreover, if you intend to be a persistence polyglot, your options are complicated. How many of you put everything in the database? Does that image really belong in there? How about those PDFs? How about your application configuration and set up information? Couldn’t blob storage do a much better job of saving that binary data? Couldn’t you use a document database to store that configuration data? Modern enterprise applications have a very diverse set of data and using a relational database for all of it means you’re fitting square pegs in round holes.

A number of design patterns can help you to abstract your application business logic from how you persist your data. You *are* using design patterns, aren’t you? A simple pattern to use is the Repository pattern. Done properly, you can completely hide the complexities of how to persist your data completely from the rest of your application leaving you the option of doing synchronous replication to one or more replica copies of your data, which can help to ensure you have a transactionally-consistent copy of your data. Or you may choose to use asynchronous replication for higher performance at the risk of some small amount of data loss. Both approaches require your application to detect failures and to switch from the master to the replica copy.

Other more complex design patterns can help you with this problem at the expense of complexity.Simplicity is king in software design. Embarking on an implementation of CQRS may leave you wondering why you started in a career of software development. But it can also leave you with a superior solution to a complex problem. Moreover, by implementing this in your application, you can decouple yourself from a platform and its requirements for high availability. Like everything in software development – it’s a balance of choices. Flexibility, simplicity, maintainability, speed to market, performance, etc.

Like some on my team are fond of saying, “If it were easy, everyone would play the game.”

Saturday, July 5, 2014

OneDrive and File Indexing Is Killing My Virtual Machine

I started noticing my VM lagging badly over the last couple of weeks. I frequently notice that especially at start up that the services for Windows Search Indexing and OneDrive Sync Engine are eating up at least 30% of my CPU – sometimes more. And of course it’s banging on my disk as well. For now, I’m going to pause syncing, but I think there’s a more serious issue. I’ve seen other posts online that I’m not alone.

image

I’m hoping Microsoft will provide an update that will correct this as it is becoming more and more of an impediment.

Technorati Tags: ,,

Thursday, June 5, 2014

Visual Studio 2013 Project Errors

I started getting this error right after trying to add a new project to a Visual Studio 2013 solution:

A numeric comparison was attempted on "$(TargetPlatformVersion)" that evaluates to "" instead of a number, in condition "'$(TargetPlatformVersion)' > '8.0'"

A quick Google search for the error and I find that others have experienced this problem due to Resharper. Sure enough, I have Resharper 8.2 installed and after doing a “Repair” of the install through Control Panel, that cleaned up the problem. It’s not exactly clear what the repair fixes, but whatever, it worked :)

Sunday, June 1, 2014

Solar Freakin’ Roadways!

I haven’t paid as much attention to green technologies as I should have. But the concept of the technology in this video is pretty darned cool. My son showed it to me and while the first part of the presentation is kind of sophomoric, the idea is pretty compelling. I’d be curious to know what the cost for new roads would be and how much it would cost to do upgrades and maintenance in comparison to what it costs to do asphalt. Of course, that’s not a fair comparison, but I know that the average politician or even average person is going to just do the simple comparison and miss the side benefits.

https://www.youtube.com/watch?feature=player_embedded&v=qlTA3rnpgzU

Log4Net, O’ Log4Net, where for art thou o’ Log4Net?

While working on a new set of services, we noticed that our logging was not occurring as expected. We had just wired in our core logging implementation that uses Log4Net. Worse, our services were starting up and then crashing – in the development environment only.

After a bit of debugging I found that the problem was that the log4net assembly could not be loaded. What?! There it sits as expected in the bin directory.But IISExpress said “no way, I can’t load it.” (I’m sure it said something like that)  :-)

What was odd was that I was able to put in some debugging code and could manually load a type from the assembly, so something is seriously amiss here. Fusion Log Viewer confirms that something is not quite right with the loading of the assembly:

*** Assembly Binder Log Entry  (6/1/2014 @ 9:03:05 AM) ***

The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.

Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable C:\Program Files (x86)\IIS Express\iisexpress.exe
--- A detailed error log follows.

=== Pre-bind state information ===
LOG: DisplayName = log4net, Version=1.2.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a
(Fully-specified)
LOG: Appbase = file:///C:/Program Files (x86)/IIS Express/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = iisexpress.exe
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: No application configuration file found.
LOG: Using host configuration file: D:\SkyDrive\IISExpress\config\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: log4net, Version=1.2.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/IIS Express/log4net.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/IIS Express/log4net/log4net.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/IIS Express/log4net.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/IIS Express/log4net/log4net.EXE.
LOG: All probing URLs attempted and failed.


We do have a number of other places where background threads run off and do some initialization work, so perhaps the problem lies there? I switched to tracking when the managed exception was thrown and lo and behold here it is…The plot thickens a bit from this point on. The call stack reveals that this is occurring in System.Web.dll. 


System.Web.dll!System.Web.Hosting.ApplicationManager.CreateAppDomainWithHostingEnvironment(string appId, System.Web.Hosting.IApplicationHost appHost, System.Web.Hosting.HostingEnvironmentParameters hostingParameters)


Now why would the ApplicationManager be trying to use Log4Net types? Specifically, "Type is not resolved for member 'log4net.Util.PropertiesDictionary,log4net, Version=1.2.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a'."


Alas, after much gnashing of teeth and tearing of cloth, I found this obscure thread (https://www.mail-archive.com/log4net-dev@logging.apache.org/msg04644.html) on mail archive that does explain things. Reading through the comments I found this nugget:


“Sounds like the webhost was creating multiple appdomains and log4net wasn't available in all of them.”


Finally, this quote from the thread seems to be the resolution, though I abhor putting things in the GAC – especially for nonsensical problems such as this.

“As a matter of fact I'm working with VS2012. I just tried this on a virtual and 
ran into this issue. Installing log4net.dll into to the GAC solves this issue
for me.”

I have to admit, this kind of thing drives me nuts. To make matters worse, this has been a problem for a LONG time. C’mon Microsoft, I know you can fix this kind of thing…now get cracking!


/smh

Thursday, April 10, 2014

Evolving to be more productive

I constantly find myself being challenged to get more done in a day. It often seems like the more I do to work more efficiently, the further I get from feeling like I'm more productive. I came across this post from Scott Hanselman that I found to be interesting.

http://www.hanselman.com/blog/ScottHanselmansCompleteListOfProductivityTips.aspx

I plan on trying to evolve towards this. The willingness to drop the ball is a hard thing though. I feel strongly compelled to do more with what I have. Perhaps by being willing to let go of the things that aren't that important that it will leave me with a higher value day in and day out.

This blog is a great example. It's not that I don't find it important to blog - I do. But I've constantly found myself deprioritizing it to the point that it never happens.

I think this blog can be a tool to help me to gather my thoughts and focus my attentions on the technologies, designs, and general learning that I need to focus on in order to continue to improve and to evolve. Hopefully in the process of doing that, others may find some nugget of usefulness there too.