Category Archives: Case Study

Under the hood of my Hack24 entry

I competed by myself at hack24. I don’t see competing alone as a massive issue personally, as it cuts down communication overhead by a massive amount. 😉

For those that haven’t heard of hackathons before, the concept is fairly simple:

  • Teams of 1-4 people.
  • Multiple challenges (at least in this event)
  • 24 hours to build a solution.
  • Only code you have written during the event (or Open Source libraries/apps) can be used.

It is quite gruelling to compete in these types of events; you have limited time and you need to prioritise your time across features and components carefully so you don’t end up with a complete backend but no frontend or similar.

Generally you omit anything that is not-essential such as login systems, logging or some error checks etc.

I used the event to test some of the ideas and applications (Microservices, RabbitMQ, Riak, Nginx, php-fpm etc) I have been using on larger projects in a smaller time constrained project – and I think the outcome proves that it works.

I am a big fan of microservices; breaking your app into small testable components with fixed interfaces is awesome for quick building and easy debugging – want to test if something is working, inject a message into the input and see what the outputs are. Once working you can mostly treat it as a single component and move onto the next piece. It keeps your mind focused and, at least for me, reduces stress.

I am a long-time PHP coder and so it made sense, when it came to quick prototyping, to use this and the lightweight Slim framework as my language of choice – both for the frontend and all the workers on the backend all running on top of a single Vultr VPS [disclosure: url contains affiliate link].

Screenshot

SMS proxy – my hack24 entry

I broke the project into 4 main parts:

  • Frontend (website, sms callback hook for receiving messages from Esendex (the challenge sponsor))
  • Receiving worker (take messages from callback and lookup entries in Riak and route to next processing step either filter or directly to sending worker)
  • Filter (responsible for transforming the message before routing the message to the sending worker)
  • Sending worker (responsible for sending the message out via Esendex)

I am open-sourcing the code as a learning tool for other people (and perhaps so I can abuse it in later events…)

You are welcome to ask any questions and I will do my best to answer them.

If you want to contact me, please use twitter or email mike @ technomonk . com

Case Study: Optimising a Cloud Application

I was recently brought in to examine the infrastructure of a small startup. This wasn’t anything really special, I do it quite often for various reasons. What was different was that they didn’t have issues with scaling out particularly – they had that working well with their shared nothing web application and mongodb backend. What they were having issues with was their infrastructure costs.

I normally work on through a 6 step process that has been built up over time –

  1. Monitor and gather stats/measure the problem,
  2. Standardise on a reference architecture,
  3. Add configuration management and version control,
  4. Start to define a playbook of how to do things (like up/downscale or provision new machines and clusters) and start to automate them,
  5. Bring everything to reference architecture/consolidate underutilised servers and eliminate unused infrastructure,
  6. Consider architecture changes to make it more efficient.
  7. …and repeat

I will take you through a case study showing how this process was used to lower their monthly costs. Names and details have been changed in places to protect the guilty… 😉 Continue reading