Skip to content

Tags

#mysql

Posts tagged #mysql on Dynamo Geeks: 3 posts from the community, most useful first.

3 posts

Posts tagged #mysql

  1. Article

    Two cashiers, one last bottle of kecap: fixing overselling in a Laravel POS with row locks

    One of my clients is a small minimarket chain, 4 stores, 6 cashiers per store at peak. Last Lebaran, the day before the holiday, the stock report showed -14 bottles of kecap manis . Negative stock. The owner asked me, very politely, how we sold 14 bottles that do not exist. Good question, mas. The bug $product = Product::find($id); if ($product->stock < $qty) { throw new OutOfStock($product); }…

    Bayu Setiawan14likes9comments

  2. Question

    Multi-tenant Laravel for 40 koperasi: one database with tenant_id, or one database per tenant?

    Hello all. I maintain a savings and loan system (koperasi simpan pinjam) used by 40 cooperatives. Same features for all, each has 2,000 to 20,000 members. Laravel 10, PHP 8.2, MySQL 8, one VPS. Now it is single database, every table has koperasi_id , and I use a global scope: class KoperasiScope implements Scope { public function apply(Builder $builder, Model $model): void { $builder->where(…

    Bayu Setiawan4likes8comments

Get the best of Dynamo Geeks weekly

One email each Monday with the most useful posts. No spam; unsubscribe in one click.