Insight 06 Engineering
Engineering Scalable Digital Infrastructure in Yemen
Published by Al-Sharafi Digital Solutions · Digital Agency Communications
Most companies treat infrastructure as the layer nobody sees until it fails. In Yemen it is the product. A customer on a congested mobile network judges a marketplace on whether a booking survived a dropped connection, whether identity verification completed on the second attempt, and whether the price shown was the price charged. That is the frame we work from at Al-Sharafi Digital Solutions, where Yousif Al-Sharafi leads the engineering: in a frontier market the architecture decides whether the product functions at all, so scalable digital infrastructure in Yemen is the primary engineering deliverable and the interface its most visible surface.
The Infrastructure Is the Product
The application is the visible half of a system; the substrate is the half that determines whether the visible half can be trusted. Our work starts with contracts rather than screens: versioned API schemas with a compatibility policy, idempotent mutation endpoints, correlation identifiers threaded through every call, and infrastructure defined in code and released through reproducible pipelines. Each component is built to be replaced without a rewrite. The same substrate carries Ostool and the Sharafi News network.
Operations belong to the design, not to a later phase. Structured logs on a shared schema, distributed traces across service boundaries, metrics describing user-visible behaviour rather than machine internals, and error budgets tied to service-level objectives we review. Where a service can degrade, the degradation path is documented before it ships.
Designing for the Network You Actually Have
A deployed system should assume the link will fail. Bandwidth, latency and stability vary, and a handset can lose power as readily as signal. The response is mechanisms, not slogans. On the client, reads are served from a local store and reconciled in the background, while writes are placed in a durable outbox carrying a client-generated identifier and retried with exponential backoff and jitter. Payloads are compressed, paginated and budgeted. On the server, requests carry an idempotency key, so a retried mutation is recognised as the same operation, not a second booking.
The data model follows from that decision. Every entity carries a client-generated identifier and a version, state changes are recorded in an append-only local log, and the server keeps the authoritative projection. Last-write-wins applies only where the semantics allow it; elsewhere the model names legal transitions explicitly. A booking is a state machine, an inventory hold has an expiry, and a conflicting edit is settled by rule rather than by whichever device synchronised last. A schema designed for a perfect network produces an application that fails on an ordinary Tuesday.
Real-Time Data Is a Correctness Problem
Real-time is a consistency contract, not a product label. The property that matters is that the system converges on one correct state even when a transaction is interrupted halfway. That requires a single source of truth: the server holds authoritative state, clients hold projections of it, never a competing copy. State changes are published as domain events to a durable log, and consumers are written to be idempotent because delivery is at-least-once. Where a write touches both the database and the log, a transactional outbox closes the gap, and the relay publishes with retries and a dedupe key. Mutations carry idempotency keys and optimistic concurrency tokens, so a stale write is rejected instead of silently applied.
Multi-step operations are modelled as explicit sequences with compensating actions rather than distributed transactions. Reconciliation jobs compare client projections against server state and repair drift, and every privileged or financially significant change is written to an append-only audit trail. If a connection drops in the middle of a booking or a payment, the system reports the operation as pending and reconciles it later. It never asks the server to guess, and never discards the user’s intent in silence.
Identity, Security and Trust
Trust in a marketplace is an engineering property before it is a message. It starts with identity: single-use passcodes delivered over channels with a fallback route, step-up verification for sensitive actions, and a documented review workflow for suppliers and fleet operators who submit identity documents. Verification is a state machine with an expiry, not a form that either submits or fails.
On the security side, data is encrypted in transit with current TLS and encrypted at rest, secrets are managed outside the codebase, password material is stored with a memory-hard hash, and access tokens are short-lived and rotated rather than permanent. Authorization is role-based and least-privilege, scoped per operation, with separation of duties between the operator who approves a supplier and the one who operates its fleet. Documents are served through signed, expiring links. Every privileged action is logged with actor, target and timestamp, and personal data is kept out of general application logs.
AI on a Sound Substrate
Intelligence is the layer most easily built on a foundation that was never validated. A model will produce a confident answer over a pipeline that drops events, duplicates writes or serves stale reads. We treat AI features as consumers of the same infrastructure, subject to the same obligations: a labelled, versioned evaluation set, offline evaluation before release, monitored drift afterwards, and a deterministic fallback whenever confidence is low or the network is poor. Where a decision carries financial or safety consequence, a human approves it, and the model output is retained with the decision.
What building for Yemen taught us was less about technology than about the order of the work. The decisions that mattered were designing for the network on the first day, making every write idempotent, investing in observability before the first incident, and keeping the schema honest about what the network can actually deliver. The decisions that did not matter were the ones we were tempted to take early: splitting services before we understood the load, and adding cache layers before we knew what deserved caching. Infrastructure rarely receives the attention, but it decides whether anything else works.
For partnerships, press, or general enquiries, contact the Agency at alsharafihq.com.