Eslam coder 🇨🇦❤️
banner
eslamcoderdev.bsky.social
Eslam coder 🇨🇦❤️
@eslamcoderdev.bsky.social
Full-Stack Developer | Next.js & NestJS | Building EduPlatform & ScanLens | Learning in public.

my profile: https://my-profile-personal-nextjs.vercel.app

Github: https://github.com/eslam-cmd

Thanks for visiting my account 😊
Pinned
I'm a software developer, and I'll be sharing what I learn along the way: databases, security, performance and web apps (Node.js, PostgreSQL, Next.js).

Still learning, so corrections are welcome. Follow along if that sounds useful.
One item left in stock, two people hit "buy" at once.

Both requests read stock = 1 before either decrements it, so stock ends at -1.

One fix is letting the database decide atomically:

UPDATE products SET stock = stock - 1 WHERE id = 10 AND stock > 0;

Then check rows affected.
October 17, 2026 at 8:26 PM
I'm a software developer, and I'll be sharing what I learn along the way: databases, security, performance and web apps (Node.js, PostgreSQL, Next.js).

Still learning, so corrections are welcome. Follow along if that sounds useful.
October 17, 2026 at 8:26 PM