plainspokenfellow

stories about software development


Busy start of the year

January 26,2014

Despite the last month being off-project or so called "bench" time it's been busy. Most of the time was spent catching up on technologies, especially Azure and preparing for Microsoft certification exams. It's great when you have the time to go in depth and actually try tings instead of just reading about them. This all will help me when preparing training materials for companies bootcamp where I'll be presenting for one day if no project snatches me up over the course of the next weeks.

Last weeks I've spent learning - 2 days on how to present better and the whole last week on training for technical architects. The former one was a good exercise on how to structure presentations better and gave some good ideas how to get over writers block when preparing. It also gave an opportunity to present and see others presenting, with a subsequent review session to better understand what to improve on. Architecture training on the other hand was more like a traditional company training, focusing on how to do things "the right way" and providing us with a workshop project to complete over the course of the week. The highlights here I think was that we clarified some of the expectations people might have for our future role and validated our approaches. We had a workshop throughout the training, divided in teams and at least for me it allowed to deepen my Java knowledge - as it turns out you can do quite much based on analogies between languages and the rest can be researched/looked up as needed.

With January already ending it's likely I won't be doing much development for the engine and accept the current minimal design as sufficient, moving on to focus on switching of themes and adapting new layout for my travel blog so it's ready for next season. Once that's done I might be able to clean up rough edges and put the source to github.

Adding some images

January 13,2014

Here, some picture to liven up the monotony of text.

In it's simplest form I've finished implementing content upload. Next step would be to integrate it with the wysiwyg editor I'm using to improve the writing experience as copying links from one tab to another is not 'cool'

For the storage I'm using azure blob. After initially setting up azure table storage the use of blob storage was straightforward. The article on the azure site tells pretty much everything

Shortly after deploying the new version of this blog I noticed a flaw in my initial design - I relied on App_Data to store blog content (posts and images), however as soon as I pushed a quick bugfix through tfs to production site, the tfs deployment happily cleared my app_data folder. Nice.

After short fustration with Azure adn tfs I realized that it's just the price I was paying for trying to penny pinch the wrong way - after all azure instances should be considered disposable and should not be used for data persistance, there's another service for that.

I quickly dismissed the option to use blob storage as I wanted to move away from having files anyway. SQL is an overkill in terms of features and cost for the simple issue I'll be solving, althrough it would have been quicker and more intuitive for me to go with sql because of previous experience. So Table storage it is than.

I started implementation changes with refactoring to separate logic and data handling better to be able to use different data providers. Dependency injection comes handy here as I can just specify what logic to bind to interfaces when registering the container and after that I don't really need to care about what provider is beeing used.

switch (storage)
   {
      case StorageProvider.AzureTableStorage:
          container.RegisterType();

          break;
      default:
          container.RegisterType();
          break;
   }

This separation of business and storage logic had the nice side benefit of allowing better testability, and there is still work to be done to allow the same inside storage logic implementation as currently it's tightly coupled with table storage - adding dependency injection and adequate tests there would allow safer changes for that logic.

So far the data store responds quickly and I'll leave it for a few days to monitor cpu consumption before adding caching.
While learning about table storage I read a great article by  Troy Hunt about his experiences working with 174 million records. It's an interesting read and shows examples for most common operations one would need.

Next step currently would be to sort out image attaching/storage and serving for blog posts. Another thing is to get rid of jquery and bootstrap from blog theme, while it serves well in admin site and while prototyping the page I think I am loading too much javascript.

A new engine for this blog

January 10,2014

There, changed the roof a bit for this blog.

During past month I played around with Blogengine.net (including beta of the new version) and didn't quite like all the things there. Don't get me wrong though - I still think it's a good blog engine and quite newcomer friendly. The trouble I got with it is that admin and frontend logic was mixed up - admin related css and js was being loaded for everyday blog visitors and I didn't see a simple way to disable it through theming only. So instead I did something I may come to regret at some point, but something that felt the right thing in context of me preparing for ms certification - I decided to make something myself.

So here we are. Probably a bit buggy, without some features but finally it's something where I can geek out with tweaking things to my liking. There is still a list of features that I haven't gotten around implementing, but with a total of ~40 hours spent on development I can't complain too much. Many of things were much simpler (like setting up auto deployments on azure) than I initially anticipated, although I did stumble on some "features" that were not as straightforward (selecting editor for administering posts).

Little engines that could

December 21,2013

While I still stick to blogengine.net I've been looking around at other options that could run my blogs. After initially rejecting self hosting Ghost I browsed around checking out GithubPages and even entertaining the idea of wrapping my own engine - good that a quick reality check later I stopped thinking about that.

One thing that I found was a neat little thing called MiniBlog by Mads Kristensen. It's indeed a compact thing and incorporates things that I wanted from my blog engine. While it's not asp.net mvc, having Razor to work with seems to be close enough. Script minification is done much better and it has a minimal admin interface for editing posts. One downside of the minimalism is that post writing is meant rather for Windows Live Writer than using admin interface. I would have preferred a more functional admin dashboard (that allows simpler changes to blog config) On the other hand a giant advantage is that it supports the same blog post format as blogengine.net (as it's done by the same guy) and migration is really painless (if you disregard configuration hurdles).

For now I'll test how much resources the engine uses in Azure and that will probably be the basis for any changes - either moving to MiniBlog or creating a theme for blogengine.net and waiting out any updates for Ghost blog and also just found out that blogengine.net is upgrading to 2.9 in near future ... so many choices

Thoughts are infectious

December 16,2013

One thing that came out of my experiments with Ghost blog engine is that I started to pay more attention to what my blog is doing under the hood. For now I've reverted everything to use blogengine.net so I can keep my sanity and continue to do other things whilst still having a blog, however the script and css loading that's going on in the background is starting to bother me.

During this weekend I dug through the code of the engine and theme and for someone who's been doing application performance optimization I was left surprised at how chaotic project structure is (even though I've only just upgraded, changed the theme and added a few extensions) - I've found 3 sets of jQuery and redundant pairs for some of other scripts. Also bundling only ever happens for blog internals and themes are left to live their own life. Of course I can take matters in my own hands and change things, however this would mean no more easy upgrades for bug-fixes.

Recently I had the opportunity to work with asp.net mvc once again and it brought back pleasant memories - I'm tempted to fork some newer engine on github and continue from there onwards. However that would mean I would mean more time investment to maintain that thing once I migrate. I've really enjoyed things that "just work" out of the box so far and I know that I'll miss some of the administrative features. I've tried funnelweb a while ago, unfortunately I was turned off by some of the "built by developers for developers" line of thought and it lacked some features at that time.

Have to sleep a few nights on this before making any decisions. On a side note, there is a great post from Phil Haack about migration of his blog to Jekyll .. one more option to host a blog.

 

Once again random tweets seem to pop up just when they are most needed, so today I learned how to properly control access to azure websites.

The process itself is quite simple, but I'd like to add steps how to add this to your web.config so it is only added when publishing to Azure.

First ensure that you have a web.config transform specific for azure deployment and in there add "Insert" transform to add specific configuration

<system.webServer xdt:Transform="Insert">
      <security>
        <ipSecurity allowUnlisted="false" denyAction="AbortRequest">
          <add ipAddress="127.1.1.1" allowed="true" />
        </ipSecurity>
      </security>
 </system.webServer>

Replace 127.1.1.1 with outside ip address of your machine (or network, whatever is visible to Azure) and access will be given only to that IP

Updates, updates, updates

December 10,2013

Settling in for blogengine.net for my blogs for the time-beeing. There are some things I don't quite like (post editor for example - ease and convenience of editing is a ), it seems like the best option for me currently.

While experimenting I tried Ghost blog and was quite happy with the direction it's moving on. Currently it's bare-bones posting with no out of the box support for comments or static pages, but the development is proceeding at quite a pace and I'm interested to see where it'll be in a years time. One of the reasons I didn't go with it is that it showed higher CPU usage than blogengine.net with the nearly non existent load my blog generates (I'll probably do some more extensive performance testing once the platform matures and I have some spare time)

This weekend I'll be updating themes for my blogs, let's see how that goes.