SQL MAX() and GROUP BY for CouchDB

While re-writing a couple SQL statements into CouchDB we got stuck when we wanted to do a SELECT MAX(...), id ... GROUP BY id in CouchDB. MySQL Imagine the following SQL table with data: In order to get the latest deploy for each project, I’d issue: Simple. But what do you do in CouchDB? CouchDB My documents look like this: So, after more than a couple hours trying to wrap our heads around map-reduce in CouchDB, it’s working....

October 4, 2013 · 1 min

Hosted MySQL: Amazon RDS (and backups)

Among all the different technologies in our stack, we also use MySQL. While we still run MySQL (or Percona-Server) ourselves, we selected a managed solution to power parts of our production infrastructure: a Multi-AZ setup with Amazon’s RDS. AZ is Amazon-speak for “availability zone”, essentially a datacenter. RDS stands for: Relational Database Service. Judging from my experience with our own setups where EBS is in the mix, I have to say that Amazon does an outstanding job hiding these potential issues with RDS from us....

March 17, 2012 · 8 min

Legacy code

Some people have this misconception that there is a plot to kill of the original mysql extension (aka ext/mysql) in PHP. So first off, I know that bloggers are not journalist. So apprently fact-checking is not required for a rant blog post. ;-) But if a blog post is a rant, it should be labeled as such. Improved ext/mysqli (hint: “i” as in improved) has been the goto extension for years....

July 17, 2011 · 2 min

Zend Framework: Writing an IN-Clause with Zend_Db

I’m currently running a little database analysis to see how many of our users might be affected by Gawker’s breach of security the other week. Since we use Zend Framework, Zend_Db is our weapon of choice. Running the queries I noticed, that Zend_Db doesn’t seem to support an IN-clause with a straight fetchAll(). The IN-clause is only supported when I wrap my statement with Zend_Db_Select, which is something I rarely do....

December 19, 2010 · 2 min

EC2 security group owner ID

I recently had the pleasure to setup an RDS instance and it took me a while to figure out what the --ec2-security-group-owner-id parameter needs to be populated with when you want to allow access to your RDS instance from instances with a certain security group. To cut to the chase, you need to log into AWS and then click the following link — done.

May 9, 2010 · 1 min