Databases 17 min read

How SuNing’s O2O System Uses PostGIS & Citus for Scalable Geospatial Retail

Facing the post‑pandemic slowdown of e‑commerce growth, SuNing pioneered an O2O “smart retail” strategy by integrating online and offline channels through its “Anytime Business System,” which combines PostGIS‑enabled geospatial analysis, PostgreSQL high‑availability clustering with Citus, and seamless data flow across front‑end, transaction, and support layers.

Suning Technology
Suning Technology
Suning Technology
How SuNing’s O2O System Uses PostGIS & Citus for Scalable Geospatial Retail

01 O2O "Dual‑Line Fusion"

2020 marked a turbulent year for e‑commerce, with the "stay‑home economy" driving a second wave of explosive growth that reshaped many industries and generated strong positive externalities for logistics, payments, and advertising. After years of rapid expansion, the e‑commerce model shows signs of fatigue, and new growth points are hard to find.

02 Integration of SuNing’s Shopping Chain

SuNing, a pioneer of online‑offline (O2O) integration, has built a unified retail ecosystem that combines physical stores (SuNing EasyBuy, SuNing Plaza, SuNing Small Shop, etc.) with online platforms, leveraging home‑delivery services to bring consumers closer. Precise stitching of online and offline operations, enabled by technology, is the key breakthrough of SuNing’s "smart retail" strategy.

The O2O model empowers by integrating resources rather than creating separate silos. Online shopping reduces selection cost but suffers from fulfillment delays and complex after‑sales. SuNing’s nationwide sales nodes can break these barriers, channeling online traffic to stores, expanding promotion reach, and lowering marketing costs.

Offline nodes also serve as pick‑up points, micro‑warehouses, or relay stations, enabling seamless last‑mile delivery.

SuNing’s core shopping flow consists of four modules: the front‑end (SuNing EasyBuy app, mini‑programs), the transaction middle‑end, the support back‑end, and the merchant platform. Users are guided from the homepage or search to product categories, then to the transaction middle‑end for order creation, payment, and fulfillment. The support back‑end handles warehousing, delivery, and after‑sales, while the merchant platform manages store onboarding, promotion, and data sharing.

03 "Anytime Business System" Technical Enablement

The "Anytime Business System" provides precise geospatial data processing and a unified O2O front‑end gateway, acting as the hub between the front‑end and transaction middle‑end.

It interacts with the front‑end, transaction middle‑end, and merchant platform, offering multi‑channel store‑search services that deliver location‑based store information, recommendations, pricing, and delivery options.

Figure 1: Architecture of Anytime Business System
Figure 1: Architecture of Anytime Business System

The system is split into front‑end, middle‑end, and back‑end modules. The front‑end provides location‑based store queries, while the middle‑end processes electronic fence data, validates it, and stores geometry in EWKT format.

Figure 2: Competitive Interface Routing Strategy
Figure 2: Competitive Interface Routing Strategy

The middle‑end also handles high‑availability routing, using a primary‑secondary data‑center deployment with synchronized databases. All front‑end updates are routed through the middle‑end to the primary data center.

04 Geodata Analysis Capability

The system relies on PostgreSQL with the PostGIS extension for geospatial processing. PostGIS implements OpenGIS standards, enabling storage and analysis of complex geometries.

Geodata analysis covers two dimensions: address geocoding (transforming textual addresses into latitude/longitude) and store search (finding nearby stores based on user location). The system uses EPSG:4326 (WGS84) coordinates and stores geometry as EWKT.

Figure 3: Earth Surface and Reference Ellipsoid
Figure 3: Earth Surface and Reference Ellipsoid

Key concepts include the geoid (reference ellipsoid) and projection systems. The system uses both projected (e.g., cylindrical) and geographic coordinate systems for accurate positioning.

Examples of EWKT geometry construction:

SRID=4326;POINT(1 1)
SRID=4326;LINESTRING(1 1,2 2)
SRID=4326;POLYGON((1 1,2 4,3 9,1 1))

Validation is performed with ST_IsValid:

SELECT ST_IsValid('POLYGON((1 1,2 4,3 9,1 1))');
SELECT ST_IsValid('POLYGON((0 0,1 1,2 2,0 0))');

05 PostgreSQL High‑Availability Solution

To support millions of O2O stores, a single PostgreSQL instance is insufficient. SuNing adopts the Citus extension to build a distributed, highly available cluster.

Figure 5: Standard Citus Cluster Architecture
Figure 5: Standard Citus Cluster Architecture

Citus uses a Container‑Worker model: Container nodes store metadata, Worker nodes store sharded data. Replication ensures fault tolerance. SuNing further optimizes by enabling MX mode, allowing every node to hold both metadata and data, reducing storage waste and eliminating a single point of failure.

Figure 6: SuNing Citus Cluster Deployment
Figure 6: SuNing Citus Cluster Deployment

Conclusion

By leveraging a high‑availability PostgreSQL cluster and PostGIS geospatial capabilities, SuNing’s Anytime Business System delivers precise O2O services, seamlessly integrating online data with offline endpoints, expanding retail potential and driving a new wave of value transformation in the industry.

PostgreSQLGeospatialPostGISO2OretailCitus
Suning Technology
Written by

Suning Technology

Official Suning Technology account. Explains cutting-edge retail technology and shares Suning's tech practices.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.