XOR Media

Coding, Operations, Etc.

High Performance Web: Reducing Database Round Trips

Background

There are two main sources of latency in the backend of web applications: rendering (HTML templating or data serialization) and IO (database or external service calls.) Today we'll look at the latter and more specifically focus getting rid of extraneous database round trips. The fastest query possible is ...

(more)
In code, tagged: db, examples, performance, and sql.

Efficiently Querying for Nearby Things

It's a fairly common use case to have a latitude and longitude and want to find the closest objects to a given point. While there are heavyweight solutions: MySQL Spatial Extensions, PostGIS, they can be more trouble than they're worth especially if you're making use of an ...

(more)
In code, tagged: algorithms, db, examples, geo, mysql, performance, and sql.

UTC is the Only Real Timezone

If you're storing or transmitting time information in any way shape or form (web-services, databases, queues, NoSQL, caches, log files, or just plain txt files) the safest and thus best thing to do is to use UTC (Coordinated Universal Time) everywhere.

Yes you have to do math, but you ...

(more)
In ops, tagged: db, django, mysql, rails, time, and ubuntu.