Automated Schema Migration in a MySQL cluster

The PSeeker Database

REA stores listing and agency data for Australia in a MySQL database named PSeeker. This large, complex database plays a central role in REA’s business:

  • About 95 tables in use
  • Largest table has 38 million rows
  • 24 tables have over 1 million rows
  • Near 100% uptime required

PSeeker in production is a loose cluster of ~10 MySQL database servers, that play a variety of roles:

  • A single active, writeable master instance that runs in our primary data center.
  • Several replica slaves in the primary data center used for read-only application load.
  • A replica in our secondary data center for disaster recovery
  • A replica used for investigation by support staff
  • A replica that feeds into our data warehouse

We use MySQL statement-based replication between the master and it’s replicas. This essentially runs the same statements on the replicas as has been run on the master.

Typically, replicas in the same data center as the master will be running behind changes in the master database by less than a second. More distant replicas can be up to a minute behind, depending upon the rate of updates and the bandwidth between the servers.

Manual Schema Management

Schema changes, such as adding columns or new tables, occur as new products are built or legacy systems are upgraded. They originate with the development teams involved in building or upgrading applications, at an average rate of 5-8 per month.

Continue reading

Our journey from Ruby 1.8.7 to 1.9.3

Recently REA made the move to Ruby 1.9.3 from Ruby 1.8.7 for our listing administration tool, a large Rails application used by realestate agents to manage their listings. The endeavour was ultimately successful, but not without significant challenges.

The most notable of these was a nasty segmentation fault. This fault at one stage caused so much pain that we believed that sharing our discoveries was necessary, in the hope that we might be able ease the pain for someone else.


Like all projects, the upgrade had a number of inherent challenges and restrictions. We had to fit it in between major project priorities. We also had to make sure that one of our shared libraries, which describes common domain objects for several other internal Rails applications, maintained compatibility with 1.8.7.  This effectively meant that the build pipeline needed to create artifacts for both 1.8.7 and 1.9.3, and the source had to be compatible with both.

Continue reading

Git as a hiring tool

The greatest resource of any company are the people who work for it. Therefore the process by which you hire the people who work for or with you, is extremely important. At REA Tech we have always been keen on trialling new ways of hiring people. We have played around for years with utilities such as, sample algorithm questions, and even the one hour pairing session with tech leads and other software developers for a substantial amount of time on a business feature. We in the Media and Developer team decided to try and use Git as a means of sorting out the initial set of candidates before bringing them in for the face to face interview. Git is a wonderful version control system designed by Linus Torvalds and one of its features is the history of changes it keeps. This is the most critical feature of Git we chose to use as a candidate sieve.

The purpose of the initial test is to ensure that the person who has applied is indeed a skilled software developer. Previously we have used Codility for that, but in my opinion, the information that it conveys is limited. You only see a very narrow window of the persons technical expertise and whats worse you are limiting them in terms of time. You want the person to perform to the best of his/her abilities and for that reason, you need to give a bit of leeway in terms of what time can they have to do the test and also, the format of the question. To that regard, we decided to reorder our interview test.

Continue reading

Java to Scala cheatsheet

We’ve started some new work in Scala!  Most of the back-end developers in the Residential team have a Java background though,  so we put together this cheatsheet to help get the team started.

Scala does almost everything Java does, plus a whole lot of useful functional stuff.  There’s a direct analog in Scala for almost everything in Java.

Keep in mind though, real idiomatic Scala needs a bit more than just Java semantics — there’s lots of really powerful and useful functional features and idioms that you can learn as you go.

Annotation declaration

Java Scala
@interface Foo {

trait Foo extends StaticAnnotation {

  • There is no special syntax for annotation definitions.
  • An annotation has to extend scala.Annotation, or one of its sub-traits.
  • Scala’s compiler will stitch it into the necessary bytecode form for use in Scala or Java.

Continue reading

Meet our CIO – Captain Agile!

Captain Agile Minecraft Avatar

Nigel’s Minecraft avatar – Captain Agile!

Nigel Dalton, our Chief Information Officer, is a great champion for the engineering and innovation culture at REA. Here’s an interview Nigel recently did for CIO Magazine published in full to give you an insight into his psyche.

What’s your name and title?
Nigel Dalton, REA Group’s Chief Information Officer. I also have a role as an executive coach for our team that runs the Commercial real estate line of business within REA Group in Melbourne.

What’s your professional background? How did you get to where you are today?
Social scientist, not an engineer – but I have a passion for machines that has proven powerful when combined with an innate passion for people. I have worked globally in both IT and business roles (marketing, sales, product and service), and often in the twilight zone between those more traditionally defined professions – in modern digital companies, they are the same thing.

Continue reading