The Trillion Dollar Post: Better late than never
Last Thursday (Feb. 28th) the company I work for hit a major milestone. Upon adding First MLS to our system we topped 1 trillion dollars worth of properties in out databases. This value is made up of the asking price for properties for sale throughout the nation in the 160 or so MLSs that we service. We were getting close to this mark last December, but a lot of properties dropped of the market on January first. Enough that our system totals dropped by over 60 billion dollars.
Now for the geeky bit. To track this number I wrote a php script which runs as a cron under the php-cli which queries every single property in our system. It’s written in such a way that most of the work is done by mysql, so it actually runs quite fast. Querying 2.7 million properties takes roughly 10 minutes.
For every property table in our system I use mysql to get a sum(), a min() and a max() for the listing price column. That information is then saved to an XML document so it can be read cross server for various applications. Generally when I write a script to parse thisĀ XML I will use simpleXML to break it up and then load it’s values into a heap table. From there it’s easy and fast to run queries without having to wait the 10 minutes to query every property.
We still have at least 650 more MLSs in the US alone that we don’t yet service, so who knows what we might be able to hit.