by Paul Jones
When dealing with databases, developers frequently run into the N+1 problem, in which they populate domain objects via queries in loops. This causes terrible performance drags. The talk shows how to solve the N+1 problem in plain PHP as well as Postgres. It concludes with a way of automating the PHP side, and includes editorializing about the origins of the N+1 problem in the developer mindset.
Recent shifts in the tech world - including PaaS, cloud-services, and NoSQL - have dramatically altered the manner in which software is written, deployed, and run. This talk will discuss how PostgreSQL fits into - and can potentially take advantage of - this world.
PostgreSQL 9.1 introduced ‘Foreign Data Wrappers’ (FDW) – a partial implementation of the SQL/MED standard for handling access to remote data sources. FDW allows PostgreSQL to expose remote data as foreign tables which then behave similarly to native PostgreSQL tables, in particular, allowing remote data to be queried with SQL statements.
This session provides an overview of Foreign Data Wrappers, looks at the native interface for writing FDWs in C, and contrasts this with Multicorn, an open source framework that allows FDWs to be developed in Python. We will show a real-world Python FDW that retrieves business data from salesforce.com, with a sample client application that demonstrates how foreign data can be combined with data held in native PostgreSQL tables using a simple SQL JOIN.
16th–20th July 2012