The Problem

Shipping Label Generating Process

Orders

Shipping Data

Frontend

PHP

Server

Shipping Label Builders

...

Fedex

UPS

DPD

...

Fedex

UPS

DPD

SOAP Services

Serial (Slow)

The Solution

  • Multi-Threading in PHP

X

  • Task Queue and Worker Processes
    • Minimun rewriting of legacy code
    • Extra load on the server
    • Queue and workers to manage and monitor
  • Java Web Service
    • Mature concurrency API
    • ThreadPoolExecutor is essentially a task-queue and workers system
    • Monolithic to Service-Oriented
    • New service to maintain

The Solution

PHP

Server

Java

Server

Thread Pool

...

Fedex

UPS

DPD

...

Fedex

UPS

DPD

In Parallel

Shipping Label Builders

SOAP Services

Shipping Data

Shipping Data

Shipping Label Ready

Shipping Label Ready

Performance Gain

  • Feature toggle: 10% suppliers
  • Kibana and elastic search: average request duration per order 70% less

Things Learned

  • Making technical decisions
  • Java Concurrency API
    • thread pool size
    • queue size
    • Saturation policy
    • Nature of each individual task
  • Working with other team
  • Service-Oriented Architecture

Thank you!

SRECTrade Onsite Presentation

By David Zheng

SRECTrade Onsite Presentation

  • 18