GPS Fleet Tracking API, Laravel to Go

The Problem #

A GPS fleet tracking system handling real-time vehicle tracking was built on Laravel (PHP) with MySQL. As the number of devices and location data volume grew, the system experienced bottlenecks:

The Solution #

Full backend conversion from Laravel → Go using Clean Architecture pattern, with clear database role separation: MySQL for domain data, PostgreSQL + TimescaleDB for location data (time-series).

Architecture #

Request → Controller → UseCase → Repository → MySQL (domain) / PostgreSQL+TimescaleDB (location)
                       ↕
                    Gateway → External API / RabbitMQ

Each layer has clear responsibilities:

Tech Stack #

Component Technology
Language Go 1.26
HTTP Framework GoFiber v2
Database MySQL (domain data) + PostgreSQL/TimescaleDB (location/time-series data)
ORM/Driver pgx/v5 (raw SQL performance)
Messaging RabbitMQ (amqp091-go)
Cache Ristretto (in-memory)
Migration golang-migrate
Validation go-playground/validator
Auth JWT + unified auth

Key Features #

Results #

Lessons Learned #

  1. Clean Architecture enables gradual migration: each endpoint could be converted one by one without breaking changes, allowing v2 (Laravel) and v3 (Go) to run in parallel during the transition
  2. pgx/v5 > ORM for high-throughput: full control over SQL queries delivers more predictable performance compared to ORM abstractions
  3. TimescaleDB is a game-changer: hypertables + compression keep millions of location records per day stored efficiently and fast to read.