July 14, 2013

The old blog site

This is one of my first sites that I have hosted myself. There were so many different things that I had to do for this project, so it was a bit of a learning experience for me. Here are the things I learned from implementing the site:

1)Figure out hosting
2)Develop or Use a blog engine
	2a)In developing, I learned about HTML5 and <a href="/blog/5">Templating</a>
	2b)Javascript and using libraries like <a href="/blog/9">Linq</a>
	2c)CSS3, <a href="/blog/6">Responsive UI</a>, <a href="/blog/7">Google Prettyify</a>
	2d)Picking a server technology (<a href="/blog/3">node.js</a>)
	2e)Picking MySQL database
3)Optimize site for performance

I discussed why I wanted to build a blog here, but with this project, I also wanted to learn HTML5, CSS and Javascript by diving deep into it. Building my own site would give me great insight into this technology, so I had to start with hosting. I received a free account with Microsoft Azure for having an MSDN account through Quicken, so I decided let’s try this platform out. The great thing about Azure is there are multiple different options to host, and it was great to see them.

I started with a VM. It worked great, but the idea of maintaining it was something I did not want to do. The VM’s come in Linux and Windows flavors, so if you are looking to use them, go for it. The real lesson learned was Microsoft Azure does not have to be just Microsoft products.

Next, I looked into web workers and web sites. The thing I took away from these 2 options is that they will allow you to not maintain a system, which is great. Web workers give you more control of administrative tasks that need more access, at the cost of process time per hour. Web sites, do not have need for administrative tasks, and are cheaper, so I decided to select the websites.

After selecting all of this, I needed a blog engine. Like I said above, I wanted to build something to learn more about administrating a site. This meant that I didn’t want to go for the obvious selection of blogger or a word press site. Now it is true I am a .Net developer, I decided I needed MORE hands on experience with Javascript, which made me select node.js as the technology choice for the engine.

I threw together all the stuff from section 2a-e and made great progress with the site. It worked great, but one of the things I did notice, once the initial site was up, was that I needed to worry about too many connections to the database. With ClearDB, which is the provider of MySQL for Azure, you only have a few connections. Makes me wish I had a DBA team dedicated to my project like at work, but it was a good lesson about conserving resources. So in order to help with connections, I put a pool in place to help manage connections properly. Of course, with limited connections, the site responses slow with more users, as they are waiting for connections to free up. There is a solution for this, Caching.

I built a caching library that expired old data based on time and number of caching objects. The library was easy to build out using the linq library, as I could find old data easy to eliminate stale data properly. All of this, put together, is what is keeping the site from hitting the database. As time goes on, I may need to switch to redis if I add more and more server instances, but my single server caching will do for now. The point is, this project has been great for learning how to host, maintain and use a great platform. Of course, if you have any questions about how I implemented this, please let me know at jordenashleylowe@gmail.com