Case Study 04

POS & Inventory System

A POS must keep checkout and stock writes correct while product browsing, reports and side effects scale independently. This case study shows how Laravel app servers, database servers, Redis and workers evolve from one user to a very large store network.

1 user — transactional monolith

1 APP SERVER
Cashier
Laravel POS #1sale + inventory logic
MySQL #1products / stock / sales
Receipt

Laravel server job

Validates cart data, checks user permissions, calculates sale totals and runs the stock/sale transaction.

Database job

Sale creation and stock deduction happen atomically so a failed checkout cannot leave inventory half-updated.

Why simple?

One cashier does not need a load balancer, Redis cluster or database replicas.

~100 users — multi-terminal / multi-store growth

1–2 APP SERVERS
Stores / Terminals
Load Balancerif second app added
Laravel #1–2
Rediscatalog / sessions / locks
MySQL Primary
Queue Workeremail / exports

Why Redis?

Product/catalog reads and shared session data can come from memory, while authoritative inventory writes remain in MySQL.

Concurrency

Row locks or optimistic version checks protect the final stock units when two cashiers sell at the same time.

Workers

Reports, emails and large exports run in background workers rather than blocking cashier requests.

~1 million users — scale operational reads and writes differently

6–15 APP SERVERS*
Stores / Apps
API Load Balancer
Laravel POS Pool6–15 example nodes
Redis Clustercatalog / locks / queue
Transactional Primary + Replicas
Worker Poolreports / sync / integrations

Checkout path

Sales and inventory writes still go to the transactional primary. Product browsing and safe reads can use cache/replicas.

Store identity

Every stock record needs store/location keys. Idempotency keys stop duplicate sale creation when terminals retry requests.

Reporting isolation

Operational checkout queries should not compete with large historical reports; replicas or a reporting store handle analytical reads.

~10 million users — large retail network

25–70+ APP SERVERS*
Global Store Network
Regional Gateways / LB
Regional Laravel Fleets
Redis Clusters
Partitioned Transaction Datastore/region ownership
Event Backbone
Analytics / Reporting Store

Regional isolation

Large store networks can keep operational traffic close to a region and reduce the blast radius of a single infrastructure failure.

Offline stores

Where WAN connectivity is unreliable, local queued sales and controlled synchronization need explicit conflict/idempotency rules.

Events

Completed sales can publish events to analytics, loyalty, notifications and integrations without coupling those systems directly to checkout.

*App-server ranges are examples, not guarantees

A POS serving millions of customer accounts may still have far fewer concurrent cashiers. Size Laravel servers from peak checkouts per second, catalog traffic, PHP-FPM utilization and database transaction latency—not registered user count alone.