Posted on

Updating your AWS Auto-Scaling AMI to a new version

In this post I’ll run through the quick steps required to update your AWS Auto-Scaling group to use a new EC2 AMI. This post builds on the guide covered in my earlier post on setting up an Auto scaling group for an elastic load balancer, which in turn was built on the WordPress clustering guide. You could say this is part 3 in a rather long-running series.

There’s not much too this process thankfully.

Step 1: Create your new AMI

The easiest way I have found to do this is actually via the EC2 console. All I do is start a new instance on my current AMI, log into it and make any changes required (install/update packages etc) and then from the EC2 console, select the instance.

You don’t often need to log into the slave nodes, so if you need a refresher on how to do it, this command is all you should need:

ssh -i path/to/your/key.pem user@your-public-ip-of-the-node.compute-1.amazonaws.com

Continue reading Updating your AWS Auto-Scaling AMI to a new version

Posted on

App Engine Java MapReduce Example: bulk deleting entities

As you may know, we run our OrderPipe ecommerce dashboard on Google’s App Engine – I’m a big fan of the platform, but it has some traps for new (and old) players. A recent issue required us to bulk delete entities on App Engine, and for that it seemed the best tool for the job was the ‘Mapper’ part of Map Reduce. It was a good experience learning a) how it works and b) applying it, I thought I’d document a full Map Reduce example, because the worked examples I found were all based on an older version of the library.

Background

You might be interested to read a bit about why I had to use Map Reduce – it was my own fault. A subtle bug in a recent release caused an additional Account to be created under certain situations – it made it past our staging server, because that certain situation happened infrequently enough to not cause an issue, but once it got to production, where we have many thousands of orders arriving daily, we started seeing a lot of zombie accounts being created. My first thought was we were being attacked, but alas, it wasn’t an attack, just a bug! The nett result, we were left with 10’s of thousands of unwanted entities.

The Problem

In App Engine, the datastore is highly scalable, but it’s not relational, you can’t just run a simple query to delete all rows in a table with a particular created timestamp. There are simple tools to blindly delete all entities of a type, but not entities that meet a particular condition, and more importantly, not related entities that also meet a particular condition. That’s where Map Reduce comes in, basically we shard the entities and create multiple parallel workers to break the collection into smaller parts and process through them quickly. This seems like an inefficient approach until you consider scaling beyond a single database server, or even a single database cluster.
Continue reading App Engine Java MapReduce Example: bulk deleting entities

Posted on

We won the Deloitte Fast 50 Rising Star!

In non-software-development news, I’m very proud of our recent Deloitte Fast 50 Rising Star award and wanted to share the video with you all. Paul does a much much better job of explaining what exactly it is we do, than I do. So if you’ve ever been a bit baffled, now’s a chance to get a 2 minute overview.

You get to see OrderPipe on the iPad in the video, chuffed to see software I’ve written getting some attention.

Normal (geeky) service will resume now – I’ve been trying out the Nexcess Turpentine extension for Magento Varnish, and will report on results soon. Initial impression is positive.

Posted on

Improving Magento ImportExport module with Better file format and Google Docs integration

In this post I’ll run through two ways that we improve the default Magento ImportExport module when importing products to Magento stores. The two improvements I’ll cover are: importing directly from a Google Docs spreadsheets and improving the multi-line format to make generating the import files easier.

Background to the Magento ImportExport Module

The ImportExport module itself is such a drastic improvement on the old DataFlow module it’s almost unbelievable, so let me first start by saying it’s not half bad to start with. Andreas does a brilliant job of describing the current file format, it’s in German but Google Translate plus the excellent example tables will make it quite readable. Vinai’s presentation at Magento Imagine 2011 is also required reading to understand how the new module works, and most importantly how easy it is to extend.

The two things I didn’t really like about the current functionality were the need to get a single local file to the server for processing and the multi-line format for configurable products and multi-store/site/category/image products. Here’s the changes made to improve on these.
Continue reading Improving Magento ImportExport module with Better file format and Google Docs integration