The Problem
Managing daily agricultural operations across 100+ plantation sites creates high-volume field telemetry, activity logs, and supervisor reporting requirements. Before workflow consolidation, field supervisors and operations staff spent substantial manual effort aggregating reports across disconnected views, while high-density web monitoring screens suffered sluggish response times as historical MySQL tables grew.
My Role & Constraints
Across two consecutive roles at PT Mandatech Mataram Mukti (Sept 2024 to Mar 2026) and PT Narasi Data Cerdas Indonesia / NADATA (Mar 2026 to Oct 2026), I worked across the full stack on GGF-FMS: React 18 + Mantine + TanStack web dashboards, React Native (0.79) mobile apps (com.ggfsystem.fmsmobile) backed by @op-engineering/op-sqlite local persistence, Laravel 12 REST APIs, and MySQL query optimization.
Key operational constraints:
- Zero downtime across 100+ active sites: web portals and React Native mobile field clients depended on live MySQL schemas daily.
- High-volume nested operational data: plantation reports joined site hierarchies, shift blocks, worker logs, and monitoring metrics on single requests.
- Cross-platform consistency: data captured on Android field units had to reconcile cleanly with web analytics and reporting modules.
Key Decisions
1. Eliminate N+1 bottlenecks through explicit ORM eager loading & API shaping
Profiling slow monitoring endpoints showed that nested plantation hierarchies were triggering hundreds of redundant per-row queries through lazy relation access. Refactoring critical Laravel endpoints to enforce strict eager loading (with(...)) and lean response payloads cut redundant queries dramatically.
- Trade-off: Tightly scoped API resource shapes meant reporting screens could not rely on arbitrary hidden model attributes, but explicit contracts made both React web and React Native mobile consumers faster and more predictable.
Eliminating N+1 bottlenecks across 100+ plantation sites
Comparing lazy per-row relation queries against constrained Laravel eager loading.
Per-row nested queries
Each monitoring row fired extra SQL lookups for location, shift block, and worker logs.
Sluggish web dashboards + manual weekly spreadsheets
Batched with(...) & lean payload
Explicit column selection, indexed joins, and daily pre-aggregation in MySQL.
2. Streamline reporting workflows directly at data capture & aggregation points
Instead of asking operations staff to manually compile weekly spreadsheets from raw log tables, we built dedicated plantation reporting modules that pre-aggregate daily site entries cleanly inside MySQL.
Solving manual reporting friction meant addressing both backend query performance and the exact input steps supervisors used at the end of every shift.
3. Shared REST API & offline-ready field capture across React Web and React Native Mobile
Field coordinators on FMS v2.0 work offline inside active plantation blocks (Lokasi lifecycle states: Rawat, Diet, Forcing) capturing photo evidence, Catatan Lokasi (Catatan / To Do / Doing / Done), Plant Pest Disease tagging, QC Inspector checks, Jurnal PPO, and dynamic Form Studio inspections stored locally in @op-engineering/op-sqlite before syncing back via explicit Sync Data controls. Aligning frontend components and mobile sync expectations around lean REST payloads ensured reliable updates across both the web dashboard (fms.ggfsystem.com) and Android mobile client.
Unified field capture across Android mobile and Web monitoring
How offline-tolerant mobile inputs stay consistent with regional dashboards.
The Build
Optimizing Laravel 12 Eloquent queries focused on constrained eager loading (Location::query()->with(['analysesNdvis', 'analysesPlantWeights', 'plan']), FormStudioTable::with(['schemas', 'parent.schemas'])) while the mobile app persisted field notes locally in op-sqlite with explicit sync state flags:
// Verified mobile offline SQLite record (fms-mobile/src/database/dbNote.ts)
export type NoteRecord = {
id: number;
web_id?: string | null;
zone?: string | null;
location?: string | null;
status: string;
tagging?: string | null;
priority?: string | null;
description: string;
photo?: string | null;
coordinat: string;
is_synced: boolean;
note_code?: string | null;
type: string;
created_by: string;
};# Production deployment pipeline spans web portal + React Native Android release
php artisan config:cache && php artisan route:cache && npm run buildOutcome
- 40% faster data-loading speed achieved through ORM eager loading, elimination of redundant queries, and REST API optimization.
- 40% reduction in manual reporting, saving roughly 10 hours per week for operational teams across 100+ plantation sites.
- Maintained consistent cross-platform feature delivery across the web platform (
fms.ggfsystem.com) and Android field application.
Reflection
Working on long-lived enterprise software across 100+ sites reinforces that database query discipline and clear API shapes are product features: shaving seconds off a dashboard load directly affects whether field coordinators trust and adopt digital reporting over spreadsheets.



