Milad Al Usta Halabi
العربية
Menu

05Software architecture

Light Commerce

A multi-store commerce engine for slow connections

Draws on

  1. Networks
  2. Software
Role
Sole developer
Year
2026
Disciplines
Systems architecture, Backend engineering, Software engineering, Infrastructure and distributed systems
Technologies
Go, SQLite, FTS5, Caddy, libvips, HTTP/3, Telegram Bot API
Home page of the HUEC electronics store in Arabic, with a technical drawing of components

One Go binary serves many online stores from a single small server, each store in its own SQLite file, built for customers on weak mobile internet. It runs HUEC's own electronics store, in Arabic and English.

The challenge

Run many client stores, each with around 3,000 products, on one inexpensive server, and keep pages usable for customers on weak mobile connections, where bytes on the wire and the number of requests matter more than raw server speed.

The solution

  • One process serves every store. The request's host name picks the store, and each store keeps all of its data in its own SQLite file. A separate platform database holds the stores, their domains and the super-admin accounts.
  • Caddy issues TLS certificates for every client domain on demand and proxies to the Go binary.
  • The binary embeds the base theme and the admin interfaces. Store themes load from disk, so a new theme never needs a recompile.
  • Images are converted once on upload to WebP at four sizes, and search normalizes Arabic and English text over an FTS5 trigram index.
  • Isolation between stores is tested directly, with a harness that starts two stores side by side and compares them.

My contribution

Designed the architecture and built the whole platform myself, under HUEC.

Outcomes

  • In production as HUEC's electronics and 3D printing store at store.huec.online, in Arabic and English.
  • On the live store, a product page's HTML is 6.3 KB compressed and the whole page loads in 15 requests (measured on 4 December 2026).
  • Catalog, cart, checkout and orders implemented (milestones M0 to M3, November 2026).
  • In the Go load tests, catalog pages answer in 0.4 to 1.2 ms of server time at the 95th percentile on a single thread, against a 10 ms target.
  • With the base theme, the heaviest first view without images is 6.0 KB in two requests, with no JavaScript.
  • Placing an order takes 3.8 ms at the 95th percentile, and when eight buyers race for the last unit, exactly one wins: the stock is never oversold.

Documentation

Development boards category in Arabic with brand and price filters and product cards
Fig. 2 Category page with filters, Arabic
Product page for an ESP32-S3 development board with price and stock status
Fig. 3 Product page
Store home page on a phone in Arabic
Fig. 4 Home on a phone
Category page on a phone with filter and sort buttons
Fig. 5 Category on a phone
Store home page in English
Fig. 6 The same store in English