Technical Architecture and Build Practices for B2B E-Commerce Platforms

    This article breaks down the technical architecture of a B2B e-commerce platform, covering layered system design, core data models for suppliers and tiered pricing, hybrid search with information governance, transaction and settlement workflows, trust mechanisms, performance and security, and observability. It offers a practical roadmap for engineers building large-scale, trustworthy B2B marketplaces.

    1. Background and Problem Definition

    The core mission of a B2B e-commerce platform is to turn scattered supply and demand information into structured data that can be searched, compared, and transacted on, while maintaining trust throughout the entire transaction lifecycle. Compared with retail scenarios that target individual consumers, inter-enterprise trade has several distinct characteristics: the transacting parties are organizations rather than natural persons, which requires business qualification and identity verification; product specifications are complex, and the same material may have multiple sets of units of measure and price tiers; transaction amounts are large and payment terms are long, placing extremely high demands on the accuracy of settlement and reconciliation; and procurement decision chains are long, involving multiple stages such as inquiry, price comparison, and approval.

    As a result, platform construction cannot simply reuse a retail e-commerce template. Technically, three questions must be answered: first, how to express the many-to-many relationships among “suppliers—products—demands”; second, how to provide stable search and recommendation capabilities across massive volumes of unstructured and semi-structured information; and third, how to ensure that trust elements such as qualifications, reviews, and transaction records are traceable and tamper-proof. The following sections address these three questions layer by layer.

    2. Overall Layered Architecture

    A clear layered design is recommended to avoid coupling business logic with infrastructure:

    • Access layer: handles protocol termination, authentication, rate limiting, and canary routing, and uniformly processes Web and mobile requests.
    • Application layer: split by business domain into supplier domain, product domain, search domain, transaction domain, settlement domain, and risk-control domain.
    • Domain service layer: carries core business rules such as price calculation, inventory reservation, and payment-term validation.
    • Data layer: a relational database stores core transaction master data, object storage holds qualification certificates and images, a search engine handles retrieval, and a message queue enables asynchronous decoupling.
    • Infrastructure layer: the container platform handles elastic scaling, while log services and monitoring alerts provide observability.

    Each layer communicates through well-defined interface contracts. Cross-domain calls should prefer asynchronous messaging to reduce the cascading failures caused by tight coupling.

    3. Core Data Model Design

    The supplier entity should be split into a main table and extension tables. The main table holds stable attributes, while extension tables carry volatile information such as qualifications and industry tags:

    1. CREATE TABLE supplier (
    2. supplier_id BIGINT PRIMARY KEY,
    3. org_name VARCHAR(200) NOT NULL,
    4. credit_code VARCHAR(64) UNIQUE,
    5. verify_status TINYINT NOT NULL DEFAULT 0,
    6. created_at DATETIME NOT NULL
    7. );
    8. CREATE TABLE product (
    9. product_id BIGINT PRIMARY KEY,
    10. supplier_id BIGINT NOT NULL,
    11. title VARCHAR(255) NOT NULL,
    12. category_id BIGINT NOT NULL,
    13. spec_json JSON,
    14. INDEX idx_supplier (supplier_id)
    15. );

    Price should not be designed as a single-value field, but modeled as a set of “tiered prices” with (product_id, min_qty) as the unique key, supporting price lookup by purchase quantity. Inventory should distinguish between “sellable inventory” and “reserved inventory,” using reservation records to make ordering and deduction idempotent.

    4. Search and Product Information Governance

    Search demands in enterprise procurement tend toward precision: model numbers, materials, and specification parameters often must match exactly. Pure keyword matching is insufficient, so a hybrid strategy of “structured filtering + full-text search” is recommended. The illustrative query logic is as follows:

    1. def search_products(keyword, category_id, min_qty, page):
    2. query = {
    3. "query": {
    4. "bool": {
    5. "must": [{"match": {"title": keyword}}],
    6. "filter": [
    7. {"term": {"category_id": category_id}},
    8. {"range": {"min_order_qty": {"lte": min_qty}}}
    9. ]
    10. }
    11. },
    12. "from": (page - 1) * 20,
    13. "size": 20
    14. }
    15. return search_client.search(index="product", body=query)

    Information governance is the prerequisite for search quality. A category system and attribute templates need to be established, requiring merchants to fill in key parameters according to the templates; titles should be normalized to remove marketing noise words; and batch jobs should periodically rebuild indexes to ensure data consistency.

    5. Transactions, Settlement, and Trust Mechanisms

    The transaction flow should be driven by a state machine, with states including pending confirmation, inventory locked, pending payment, shipped, completed, and canceled. Each transition writes to a transaction log to ensure traceability. Inventory deduction uses reservation plus timeout release to prevent malicious orders from occupying resources.

    On the settlement side, payment terms and multi-period reconciliation must be supported. In the design, “order amount,” “discount amount,” and “payable amount” are stored separately, and all amounts use fixed-point decimal types; floating-point numbers are prohibited. Reconciliation tasks are triggered via a message queue, and failures enter a retry queue with audit logs recorded.

    Trust mechanisms consist of three layers: qualification verification (materials such as business licenses and industry permits are retained in object storage with verification records kept); behavioral reviews (two-way reviews after transaction completion, with abnormal reviews sent to manual review); and risk identification (dual interception through both rules and models for behaviors such as high-frequency registration from the same device and abnormal price fluctuations).

    6. Performance, Stability, and Security

    Under high-concurrency scenarios, multi-level caching can be introduced for hot product detail pages, and cache keys need to include a price version number for fast invalidation. Write requests are peak-shaved through a message queue, while consumers remain idempotent. At the database level, sharding is done by supplier dimension, and historical orders are archived to low-cost storage.

    For security, transport encryption is enabled across the entire chain, and sensitive fields are encrypted before being persisted. The interface layer performs unified authentication and authorization checks, with special attention to horizontal privilege escalation (using Supplier A’s credentials to query Supplier B’s products). Audit logs are stored independently, with retention periods meeting compliance requirements.

    7. Observability and Iteration Path

    It is recommended to integrate unified logging, metrics, and distributed tracing from day one. Core metrics include order success rate, inventory reservation timeout rate, search no-result rate, and settlement error rate. Alerts should be graded by business impact to avoid noise drowning out real failures.

    For the rollout pace, the first phase completes the closed loop of supplier onboarding and product publishing; the second phase fills in search and inquiry; the third phase launches transaction settlement and risk control; and the fourth phase adds intelligence, such as intelligent demand matching and price trend analysis. This can rely on the general cloud capabilities provided by Baidu AI Cloud (container platform, object storage, message queue, log service, and monitoring alerts, etc.) to achieve elastic scaling and managed operations, reducing the investment in self-built infrastructure.

    8. Conclusion

    The technical difficulty of a B2B platform lies not in any single feature, but in the long-term construction of data governance and trust systems. Only by building a solid domain model, thinking through the boundary conditions of search and settlement, and treating observability as infrastructure can a platform remain authoritative and trustworthy as it scales.