Menu

1 / 3

2 million postal codes in plain PHP and SQLite: lessons from 105 countries of open data

DEV Community: php·Konstantin Iliev·1 day ago
#OJjyv6eV
#devto#dev#codes#code#postal
Reading 0:00
15s threshold

I run WhatTimeIsIt.zone , a world clock with a page for every city. Every city also has a postal code, so in November 2026 I launched a sister site, PostalCodeFinder.net : zip codes, postcodes and postal codes of 105 countries and territories, over 2 million codes, with maps and a few free tools.

No framework, no build step: plain PHP, SQLite and LiteSpeed cache on ordinary shared hosting. Here is what I learned, with the numbers.

One SQLite file per country

Postal data changes once a month, and the site only reads it. So instead of a database server, every country is one read-only SQLite file: postal-bg.sqlite , postal-us.sqlite and so on, plus one shared search index.

The import builds a new file next to the old one and renames it over the old one when it is done.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.