Download PDF · Cloudnix: Enterprise Ecommerce
Enterprise commerce fails at its edges: a search that slows as the catalogue grows past a million products, a sale-day spike that reaches the database, a payment marked paid on an unverified callback, a tax line that does not reconcile, a branch that cannot bill when the internet drops, a marketplace seller whose edits go live unchecked, or a migration that loses years of search rankings. This report describes how we engineer around each of these, from a commerce core we have built and operated in production for many years: a multi-tenant platform serving brands, franchise outlets, wholesale stores and marketplaces on one codebase, an offline point-of-sale system for branches, and the integrations, operations and support model around them.
| Problem | Symptom | Pattern (chapter) |
|---|---|---|
| Catalogue growth | Facets and search slow down past a million products | Dedicated search index, attribute facets (5) |
| Sale-day traffic | Database saturates within minutes | Layered caching and CDN (13) |
| Many brands on one platform | Data or settings leak between stores | Store resolution and scoping (4) |
| Payment trust | Orders marked paid on forged or replayed callbacks | Gateway contract and verification (6) |
| Tax reconciliation | Paise-level mismatches, wrong IGST/CGST split | Tax in the core (8) |
| Branch connectivity | Billing stops when the line drops | Offline POS with key ranges (10) |
| Marketplace quality | Seller edits go live unchecked | Field-level approval (11) |
| Re-platforming | Lost orders, broken URLs, lost rankings | Parallel-run migration (15) |
All stores share one codebase and one release. A front controller dispatches views, form posts and modules; an administration area follows a per-entity pattern of controller, model and data access. The relational schema of the commerce core holds around fifty tables, every one of them carrying the store's identifier. Scheduled jobs handle feeds, sitemaps, cache housekeeping, backups and synchronisation.
| Option | When |
|---|---|
| Shared cloud (data in India) | Most brands; fastest to start |
| Dedicated cloud | Isolation, custom capacity, regional hosting |
| On-premise | Regulatory or internal policy requirements |
A multi-brand platform is only as safe as its tenant boundary. Before any business logic runs, each request passes malicious-request blocking and a request-rate check, then the host name (without www) is looked up against a unique domain column to find the store.
# every request block_malicious(request); check_request_rate(ip, user_agent) store = lookup_store(host_without_www) # unique domain → store id if not store: render("can't find the shop"); stop context = { templates: "themes/" + store.theme, media: "media/" + store.domain + "/", # per-store files cache: store.domain + "/cache/", # per-store cache namespace cdn: store.media_cdn, store.theme_cdn, currency: store.currency, store.decimals, payments: store.gateway_credentials, device: mobile | tablet | desktop | app }
Pseudocode.
| Concept | Model |
|---|---|
| Hierarchy | Type → category → sub-category |
| Variants | Variants and options (size, colour, cut, pack) |
| Facets | Tags grouped by type, attached to products and carried into order lines |
| Limits | Product limits per plan, enforced at upload |
| Bulk | CSV and spreadsheet uploads |
For small catalogues, tag filters on the database are enough. Past a few hundred thousand products, facet counting and relevance ranking belong in a dedicated search index (an Apache Solr core in our deployments [6]) synchronised from the catalogue through a change table. The index provides typo tolerance, relevance ranking and fast facet counts; the database remains the system of record.
A file-based cache stores rendered widgets and pages per store, with a time-to-live, a per-store switch, an allow-list of modules, pattern-based invalidation and a housekeeping job. Widgets that depend on the shopper, such as recently viewed, buy again and recommendations, are never cached. Images are converted to WebP, with AVIF handled where supported [10], and served from a CDN with versioned static paths so a release invalidates nothing it does not need to [7].
The same core runs catalogues of more than ten million products for a single customer and serves more than a million shoppers on one platform.
Checkout moves through review, delivery details, payment, confirmation of payment and confirmation of order. Payment is delegated to gateways through a single contract: each gateway is a module that implements processing of the browser return and of the server-to-server notification. The store's configured gateway is loaded at checkout; a separate gateway can be set for international payments.
| Gateway pattern | Proof checked |
|---|---|
| Signed webhook with timestamp | Signature header and timestamp verified before processing |
| Checksum header | sha256(payload + salt) with a key index, recomputed and compared |
| HMAC response | HMAC-SHA256 over the response with the merchant secret |
| Signature with order re-read | Amount and gateway order id re-read from the order (status NEW, this store only) and checked against the signature |
| Reverse hash | Hash of the reply fields in reverse order with the salt |
Ten gateways are supported behind this contract, with webhook handlers where the gateway offers them. Card data is entered only on the gateway's hosted page and never stored [1, 2].
Seven transitions send the customer a message: processing, shipped, delayed, delivered, cancelled, rejected and returned. Item-level order management lets one line be procured or returned independently of the rest of the order.
Every order line carries its HSN code, CGST, SGST and IGST rates and whether the price includes tax [4, 5]. For a tax-inclusive price P at rate r:
base = P − P ÷ (100 + r) × r tax = P − base intra-state: CGST = SGST = tax ÷ 2 inter-state: IGST = tax
Example exchange or schema.
| Example | Value |
|---|---|
| Price, inclusive, 18% | ₹1,180.00 |
| Base | ₹1,000.00 |
| Same state | CGST ₹90.00 + SGST ₹90.00 |
| Another state | IGST ₹180.00 |
Invoices render in four layouts: A4 and thermal, each tax-inclusive or exclusive, generated as PDF. A tax report summarises liabilities for the accountant.
Inventory is keyed by product and outlet, holding stock level, net price and tax rate per outlet. In multi-outlet mode, each outlet (a supplier record) has service areas, and each order carries the outlet that fulfils it.
# routing an order in multi-outlet mode area = area_of(shopper.pincode) outlets = outlets_serving(area) # service areas by pincode outlet = first(o in outlets where stock(o, items) is sufficient) order.outlet = outlet; invoice series and GSTIN of outlet cod = cod_allowed(shopper.pincode) # maintained per pincode
Example exchange or schema.
Delivery charges come from courier zones and zone rates, with delivery slots and cash-on-delivery charges by area. The platform serves more than 19,000 pincodes.
Branches bill against a local database and synchronise with head office over HTTP when connected. Twenty-five tables take part, each implemented as a sync class.
Two branches creating invoices offline would otherwise generate the same primary keys. Each branch is initialised with its own series (for example 1xxxxxxx, 2xxxxxxx), so records from different branches never collide and can be merged without renumbering.
Branch features include shifts with day-end settlement, indents and stock requests with automatic raising, inter-branch transfers, part payments, billing by weight and per-device licensing. A bridge job pushes branch stock to the online store's inventory.
Sellers onboard with tax identifiers, bank account and location, and serve defined areas. Every change a seller makes is captured as a pending approval rather than applied:
approval(table, key, field, previous_value, new_value, mode, approved)
Example exchange or schema.
The operator approves field by field; only then is the change written to the live record. Commission is configured by product type, category or sub-category; seller subscription plans carry a trial period and a product allowance. Settlement to sellers can run inside the platform or through the operator's accounting process.
| Area | Integration |
|---|---|
| Product feeds | Google Merchant Center through its Content API [8]: store set-up, nightly feed generation and push, status pull, clean-up |
| Messaging | Email via SMTP or managed email services; per-store SMS gateways; WhatsApp through the Business Platform Cloud API [9] or providers |
| Couriers | API booking with an aggregator; zone and rate tables for other couriers |
| Systems | Open API and webhooks with a key per connected system, for ERP, accounting and CRM |
Sale-day traffic arrives within minutes. The platform answers most of it before the database: a CDN with versioned static paths and modern image formats, per-store page and widget caches, and a dedicated search index. The database serves what remains: carts, checkouts and order writes.
| Layer | Serves | Invalidation |
|---|---|---|
| CDN | images, scripts, styles, cached pages | versioned paths per release |
| Page and widget cache | category, product and home widgets | time-to-live, pattern purge on change |
| Search index | search and facets | change-table sync |
| Database | carts, checkout, orders | — |
| Area | Control |
|---|---|
| Edge | HTTPS everywhere; malicious-request blocking; request-rate limits logged by IP and user agent; bot checks on forms |
| Identity | OTP and social sign-in; per-staff logins; about 190 permissions; sessions regenerated on sign-in |
| Application | Prepared statements; store scoping; function-level permission checks; checkout steps enforced in sequence |
| Payments | Hosted gateway pages; callback verification; card data never stored [1] |
| Recovery tokens | Password-reset tokens encrypted and authenticated (AES-256 with HMAC-SHA256), expiring, invalidated on password change |
| Operations | Key-only server access; named logins; monthly access reviews; critical patches within 48 hours; daily log review |
| Recovery | Daily and weekly backups, a separate copy, monthly restore tests |
We assess applications against the OWASP Application Security Verification Standard [11] when hardening.
| Step | Work | Exit criterion |
|---|---|---|
| 1. Audit and plan | Catalogue, customers, orders, URLs, integrations, SEO | Signed migration plan |
| 2. Move and check | Data moved and checked line by line; URL redirect map | Counts and samples match |
| 3. Run in parallel | Old and new live side by side; orders compared | A full business cycle without differences |
| 4. Switch over | DNS and redirects; team on hand | Traffic, orders and rankings stable |
Sources include hosted platforms, open-source platforms and self-built systems.
Anonymised. A retailer with an online store and several physical branches.
Branches had unreliable internet but could not stop billing. Stock had to be consistent between branches and the online store, and head office needed one view of sales, transfers and shifts.
Billing continues through outages; head office sees branch activity after each synchronisation; and online availability follows what is physically on the shelf.
| Phase | Outcome |
|---|---|
| 1. Discovery | Store network, catalogue, payments, tax and integration plan |
| 2. Pilot | One brand or region live; migration rehearsed |
| 3. Scale | All stores, outlets and channels; offline branches |
| 4. Operate | Service levels, monthly reviews, peak readiness drills |
| 1 | Is every request bound to one store before any logic runs? |
| 2 | Are cross-store access attempts covered by tests? |
| 3 | Does search run on a dedicated index past a few hundred thousand products? |
| 4 | Are personalised widgets excluded from caches? |
| 5 | Are images served in modern formats from a CDN with versioned paths? |
| 6 | Does every gateway sit behind one contract? |
| 7 | Is every callback verified with the gateway's own method? |
| 8 | Is the amount re-read from the order, not the browser? |
| 9 | Do exceptions (delay, rejection, return) have their own states? |
| 10 | Does every line carry HSN and GST rates? |
| 11 | Are inclusive prices back-calculated exactly? |
| 12 | Is stock held per outlet with service areas by pincode? |
| 13 | Can branches bill offline without key collisions? |
| 14 | Are sync conflicts logged rather than overwritten? |
| 15 | Do seller changes wait for approval? |
| 16 | Are integrations keyed per system and versioned? |
| 17 | Is there a parallel run before migration cut-over? |
| 18 | Are restores tested regularly? |
| 19 | Is there a staging store and a sign-off before release? |
| 20 | Who is on call on sale day? |
| Store resolution | Binding a request to one store from its host name. |
| Facet | A filter with counts, such as size or colour. |
| HSN | Harmonised System of Nomenclature code for goods under GST. |
| CGST / SGST / IGST | Central, State and Integrated GST. |
| Key range | A block of identifiers reserved for one branch. |
| Watermark | The last point synchronised, per table and direction. |
| Hosted payment page | The gateway's page where card details are entered. |
| Document control | |||
|---|---|---|---|
| Report | CNX-TR-2026-03 | Version | 1.2 |
| Issued | November 2026 | Status | Published |
| File | cloudnix-enterprise-ecommerce-v1.2.pdf | ||