How Lalamove Migrated 1000+ PHP Services to Java in One Year

Lalamove’s year‑long P2J project transformed over a thousand legacy PHP interfaces into Java, tackling complexity, stability, and efficiency challenges through standardized technical solutions, AI‑assisted code generation, rigorous testing, and disciplined project management, ultimately delivering faster, higher‑quality services.

Huolala Tech
Huolala Tech
Huolala Tech
How Lalamove Migrated 1000+ PHP Services to Java in One Year

Background

Since 2013 Lalamove built its platform on PHP and gradually shifted to Java. Rapid overseas growth created a massive technical debt: over 1,000 PHP interfaces needed Java conversion, affecting more than 100 upstream services and involving virtually every business team.

Project Challenges

Complexity vs. Time

The scale, intertwined service dependencies, and limited resources made it hard to finish on schedule. For example, the OrderInfo.get_order_info interface required 1.5 months to develop and another 1.5 months for each upstream service to adopt it if done serially.

Stability vs. Efficiency

Decades of PHP code left over 30 % of core services as low‑quality “code rot,” and simultaneous rollouts amplified failure risk. In February 2025, 51 interfaces were switched at once, causing a P0 incident.

Solution Overview

Based on earlier small‑scale migrations, Lalamove defined three pillars: a global reusable technical solution, a comprehensive quality‑assurance system, and disciplined project‑management practices.

Technical Solution

Global Flow Design

Design principles Seamless, upstream‑transparent traffic switching. Java contracts mirror PHP behavior to minimize integration effort.

A unified flow framework was built to enforce these principles.

Global Comparison Tool

An internal recording and comparison tool automatically validated more than 60 % of migrated PHP APIs without QA intervention, dramatically reducing manual effort.

Monitoring & Alerting

A system‑wide monitoring and alerting platform was introduced to expose hidden observability gaps early.

Refactoring

Avoid flashy refactors; focus on controlled domain‑level restructuring, reducing task volume by ~20 %.

Eliminate PHP technical debt from new Java services and streamline logic.

AI‑Assisted Development

AI tools generated roughly 7 % (≈150 k lines) of the new Java code.

Case: converting a driver‑system PHP API to Java using AI‑driven code generation cut manual effort by 50 %.

Quality Assurance

Testing Quality System

Goal : Deliver comprehensive, deep, and efficient test coverage.

Test Efficiency & Coverage

Using the self‑built Autoflux scenario orchestration tool, Lalamove automated end‑to‑end order‑flow testing across payment methods, order types, and operations, achieving full core‑link coverage.

After Java migration, automated test case generation with Cursor increased test creation speed by 10×, saving over 800 man‑days for 27 new interfaces.

Developers were provided self‑test tools to expand breadth, while QA received continuous training to maintain baseline quality.

Depth was ensured through targeted tests—traffic splitting, concurrency, fault injection, compatibility, exploratory, and performance testing—uncovering numerous deep bugs.

Project Management

Risk Management

Early identification of technical, business, team, and external dependencies.

Rollback SOPs for flow issues; service‑decommission SOPs for lingering traffic.

Clear priority definitions and conflict‑resolution mechanisms.

Progress Management

To avoid communication bottlenecks among the large participant pool, Lalamove leveraged Feishu multi‑dimensional tables as a lightweight low‑code platform for visualizing task status and delivering real‑time risk alerts.

Conclusion

The P2J initiative successfully migrated all targeted PHP services to Java within a year, surpassing expectations for schedule, efficiency, and quality. The documented practices—standardized flow design, AI‑augmented coding, extensive automated testing, and disciplined project governance—are applicable to other language‑migration or large‑scale engineering projects.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Backend EngineeringJavaproject managementAI automationPHP migration
Huolala Tech
Written by

Huolala Tech

Technology reshapes logistics

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.