«Older Posts |
 Tuesday, August 12, 2008

The Twin Cities Give Camp

SpoonAndCherry I’ve presented at code camps and given presentations to technical audiences and institutes and I will continue to do so. I have a passion for giving back to the community that has helped me become the what I am today. I’ve decided that I want to give back to the community even further. After doing some research to find someone (or a group) who might already be setting up a Give Camp I’ve come to the conclusion that they don’t exist here in the Twin Cities.

Therefore, I’ve decided to start up the Twin Cities Give Camp (site not complete). The web site is www.twincitiesgivecamp.org.

I’ll be updating the site this week with all relevant info in regards to the Give Camp. No dates have been set, but as soon as we have one the site will be updated.

What is a Give Camp?

A Give Camp is a weekend-long event where software developers, designers, and database administrators donate their time to create custom software for non-profit organizations. This custom software could be a new web site for the nonprofit organization, a small data-collection application to keep track of members, or a application for the Red Cross that automatically emails a blood donor three months after they’ve donated blood to remind them that they are now eligible to donate again. The only limitation is that the project should be scoped to be able to be completed in a weekend.

At the Give Camp, there is an expectation of “What Happens at Give Camp, Stays at Give Camp”. Therefore, all source code must be turned over to the charities at the end of the weekend (developers cannot ask for payment) and the charities are responsible for maintaining the code moving forward (charities cannot expect the developers to maintain the codebase).

Source

More in depth info can be found here: www.givecamp.org

Do you want to be a part of this awesome experience?

We are in need of volunteers, developers, designers, DBA’s, volunteers, Project Managers, Charities, Prizes, Giveaways, sponsors and more volunteers. If you would like to participate or sponsor this event, please let me know. I will update this blog as soon as www.twincitiesgivecamp.org is updated. I will be in contact with the local PMI, IIBA, and ISSA, AITP and local .NET User Groups.

More info to come soon!

#    Comments [2] |
 Friday, August 08, 2008

DiscountASP vs. Me

DiscountASP just won. Argh! I wrote a long blog post (because I dont have access to Live Writer on this PC) and then clicked Publish and it logged me out. Dont understand what I'm talking about? Read on .. 

Unfortunately, what DiscountASP.NET does not tell you is that due to Community Server 2007’s large memory footprint (~100 megabytes with little to no activity), DiscountASP.NET has to recycle the application pool frequently, sometimes as often as every 5 minutes. The DiscountASP.NET policy is to recycle an individual website’s entire pool once it reaches a size of 100 megabytes.

Here are the consequences of being forced to recycle the application pool on a CS 2007 server:

* All logged-in users are logged out;
* any posts that you may have been writing will be lost if you try to press the submit button;
* the entire website is brought to a crawl with slow load times;
* and in essence it makes Community Server 2007 unusable.
Source - http://www.marketing-ninja.com/hosting/discountaspnet-and-community-server-do-not-mix-despite-what-discountaspnet-advertises/
*Shakes fist violently*

 

#    Comments [1] |
 Wednesday, July 23, 2008

Is Premature Optimization Really Evil?

dominos
Photo Courtesy of: rosendahl
My first initial answer is … it depends. (Isn’t that the case for everything?) :)

Today I had conversation with a colleague and we were discussing how application developers don’t plan ahead.

This eventually brought up the question/topic:

“Is premature optimization pure evil?”

My colleague stated that all optimization should be done up front, while I on the other hand, disagree. In my opinion all development should be done first and then lets figure out where we might have some problems, with some exceptions (which we both agreed upon).

So, what did we agree upon?

Lets look at a classic example:

Developer Joe and his team were asked to create an order management system that could handle up to 10,000 orders a day. This doesn’t sound like that big of an issue, and Joe and his team also agreed. It shouldn’t be a big issue. A fast database, a fast web server, and a few third party controls to interact with. No problem! Heck, this is pretty straightforward they thought. In reality, the requirements were very straight forward, no hidden features, no scope creep, nothing like that. Heck, it was a dream project come true. With that said - development ensued, and two months later Joe’s team delivered the product and everyone was excited to see the product run from end to end. (By the way, this was not done TDD or with any Agile Methods – which IMO would have caught any of our upcoming issues, if the tests were written correctly. But then again “If ‘if’ was a fifth then we’d all be drunk”).

Joe’s team fired up the application for a demo and ran some orders through it and it worked great. They even ran 10 orders through the system in one minute (~14,400 Orders a day). They had gone above and beyond the call of duty (original requirement being 10,000 orders a day)! They were due for a raise! Life couldn't be better! The system was released and the company started to use it. Orders were flowing through the system without failure and the business was happy.

Until the company decided to sell an exclusive hot item two weeks later …

Then SHTF… All of a sudden, customers were experiencing time outs,  orders were being duplicated, and the customer service line was being rung off the hook. Essentially, all hell broke loose. After looking into the system, the developers noticed that the system had only accepted 6,000 orders. What gives? This system should handle 14,400 according to their tests. *everyone is scratching their head at this point*

Scalability is Relative

Scalability in this case, is relative. While looking at the stats, Joe’s team realized that those 6000 orders came in in about 1.5 hours. This was the first 1.5 hours that this product was available. At the end of the day the company eventually sold under 10,000 units, so why did this issue happen?

Lets take a look at some stats:

  Orders Per Minute Time Between Orders (seconds)
Original Spec (10,000 Per day) ~7 8.64
Current State (6000 in 90 Minutes) ~67 0.9

Orders Per Minute Equation: Orders / Minutes          Minutes: (HoursInDay * MinutesInHour)

Orders Per Second Equation: Seconds / Orders       Seconds: (HoursInDay * MinutesInHour * SecondsInMinute)

 

Do we see the problem here?

Again, scalability is relative. In this case, analysis and optimization was not done ahead of the time to anticipate the flood of orders at a peak period. The spec was straight forward:  The system is to be designed to handle an order rate of 10,000 orders a day. The system was designed exactly to the spec, and in this case, the system was designed incorrectly.

Now, I have a confession… 6 years ago, I was Joe. Yes, I made this very mistake. I was a hero for a couple of weeks, then SHTF. :) Live and learn. Live and learn.

When We Agreed

My colleague and I both agreed that in certain instances premature optimization should be done, such as this case. The developers should optimize the order process to handle issues at peak times. Perhaps implementing a order service, based on MQ, or implementing a service bus for this type of high-availability process would be the best. In this case, we agree. All of this analysis and optimization should be done up front because this type of thing WILL be a problem at any peak utilization times. We both agree that neglecting to analyze the problem domain can and will lead to performance problems down the road. Plain and simple.

When We Disagreed

My colleague and I still disagree on the statement of “all code should be optimized up front”. In my opinion this is a BDUF approach that I tend to shy away from. I don’t necessary mean that no design should happen up front, but I do think it should be limited. In an agile environment things tend to change, and we need to be able to adapt quickly. Wasting months in front of a whiteboard, with of reams of documentation, and endless meetings only slows the process down if something has to change down the road. Re-updating project baselines, and adjusting documentation and so forth is a huge hassle. I would like to state that there is a place for this type of development though. Some companies do require BDUF approaches because of huge regulatory compliance issues, so sometimes there is not much you can do about it. However process driven approaches such as ITIL and Agile can work together if done properly. With that said, I tend to shy away from BDUF approaches because of a simple example that is also exemplified by Jeff Atwood in a previous post of his (and I agree with him and the many other experts in the field). Jeff adds a third rule to M.A. Jacksons Optimization Rules that I like agree with the most:

And I would add a third: don't optimize work that doesn't have to be done.  - Jeff Atwood

This can be demonstrated as a sort routine. Lets say you have a menu that will be populated via user selections and the maximum number of values you can have in the menu is 100. You can either implement IComparable and utilize the List<T>.Sort() method to sort the class (which utilizes the Quicksort Algorithm) which would be SUPER easy but may not be the “Fastest” method of sorting, or you could write an extension method to create your own sort routine to sort the 100 items. At this point we’re splitting hairs. A millisecond, or even 10 milliseconds, wont matter at this point in UI response. We’re only sorting a menu that will never grow beyond 100 items. At this point, pre-mature optimization is evil. There is NO need to rewrite something that that does the job well enough. Can we do it better? Yes! Is there a need to? NO. We wont get any value out of it. The time spend on development is wasted compared to the benefit to the application.

On the other hand, if the menu had no upper bound limit, then we would want to implement the best sort routine we could because some routines are exponentially faster than others. In this case we would want to optimize early because the possibility of a bottleneck can and might occur in certain situations.

It all boils down to: “It Depends”

At the end of the day, the true answer to “Is Premature optimization evil?” is “It Depends”.

It depends on the problem. It depends on the architecture and design. It depends on analysis of the domain. It depends on the factors which “could” come into play.

Finally, what it really boils down to is: It depends on MONEY. We can optimize all day and gobs of the companies money in development/optimization costs. This is why deep analysis into the problems need to take place. As architects we need to define the business process that could impact our architecture design and implementation and development of code. At some point we need the business to interject into this analysis and optimization party to say “Listen, I’m willing to deal with X, but I’m not willing to deal with Y”. At that point, our jobs as Architects is to define how much X costs compared to how much Y costs. Only then will the business truly know what should be done juxtaposed with what should not be done.

To sum it up in my own personal opinion, premature optimization can be evil. We, as architects and developers need to think about the problem at hand before we write a line of code. As I stated above, there is no need for a full 90 page document on the process, but at least whiteboard with your colleagues. Are you a solo developer and need someone to bounce ideas off of? Join your local user group, join some groups online, visit the MSDN architecture forum and ask questions.

#    Comments [0] |
 Thursday, July 17, 2008

Mobilizing Your/My Blog - mobile.blog.donnfelker.com

Having a blog has its benefits, but sometimes people want to access your site via a mobile device and, well…. lets face it, rendering your site across many different mobile platforms, looks, well…. LIKE CRAP. Hell, half the time its unreadable.

How to Enable Your Site For Mobile Viewing

If you want to mobile enable your blog, its super-easy with the service provide by mofuse.com (no I’m not getting paid to write this). Literally its only a few steps and you’re done.

  1. Create an account
  2. Plug in your blog url that you want to “mobilize”
  3. Choose the url  you want
  4. You’re done!

You can view my mobile site at: http://donnfelker.mofuse.mobi/

Here’s what it looks like in a emulator:

Basic Mobile Phone Apple IPhone
image image

 

Sprucing Up the URL

Although this is real easy to set up, the URL “donnfelker.mofuse.mobi” just seems clunky to me. Mofuse gives you the ability to set this to a custom domain.

I wanted my domain name to be representative of the content that was being delivered, therefore I chose mobile.blog.donnfelker.com (it is the mobile version of my blog right?).

Changing this is fairly simple, however you will have to alter your DNS records. 

  1. Log into your mofuse account and click on the blog that you’ve Mobilized.
    1. image
  2. Click Custom Domain
    1. image 
  3. Enter your domain that you will be using and make note of the CNAME entry you will have to make.
    1. image 
  4. Click save and you’re now done with your mofuse portion of this task.
Adding a custom CNAME to your DNS records.

  1. This all depends on where your site is hosted and where your DNS is located. Mine is located on my host. *Important note: This will be different for each person, but this is how I alter my DNS with my host.*
    1. Log into your host.
  2. I selected my domain for editing.
    1. image
  3. Clicked DNS Configuration
    1. image
  4. At this point in time my DNS info was displayed to me. It looks like this:
    1. (Click for full size image)
    2. image 
  5. Click “Add DNS CNAME Record”
    1.  image
  6. Add the CNAME record and click Submit
    1. image
  7. Done

You will have to wait up to 48 hours for this CNAME to take effect. I did mine last night at 9pm and when I woke up at 6 it was already up and running.

 

Conclusion

Its super simple to set this up and kudos goes to the guys/gals at mofuse. Now I can go to mobile.blog.donnfelker.com and view my blog on my mobile or send the link to anyone else who wants to see it on a mobile. Excellent!  Good luck in setting up your own mobile blog!

#    Comments [1] |
 Wednesday, July 16, 2008

Passed the ASP.NET 3.5 Exam

I took the ASP.NET 3.5 Exam (in beta form) on June 5th at Tech-Ed 2008 and today I received notification that …. I PASSED! Woohoo!

What does this mean? Well, it means that I’m now an MCTS in ASP.NET 2.0 and an MCTS for ASP.NET 3.5.

MCTS_Logo

#    Comments [0] |