SShortSingh.
Back to feed

Developer finds distributed systems lessons hidden inside a simple Rock Paper Scissors game

0
·1 views

A developer built an online Rock Paper Scissors game in 2023 as a weekend project, which has since grown to include an iOS app, a Turkish sister site, and a matchmaking queue over three years. Building the game revealed classic distributed systems challenges, including the need to withhold a player's move from their opponent until both picks are locked, preventing any timing-based cheating. A race condition bug emerged at launch when two users joined the same room simultaneously, both seeing an empty seat — a check-then-set flaw fixed using atomic Redis operations. The developer chose to keep all live match state in Redis with a time-to-live expiry, reserving PostgreSQL only for completed match records, which kept the database lean and allowed horizontal scaling. A silent failure in the iOS Live Activity feature, caused by a swallowed error in a token refresh path, went unreported for weeks, highlighting the danger of features that fail quietly without user-facing feedback.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Developer builds reusable AWS EventBridge scheduling primitive for deferred workflows

A developer building automated workflows for the Ready, Set, Cloud platform needed a simpler way to schedule deferred events without relying on AWS Step Functions Wait states. The solution involved placing an EventBridge Scheduler behind an EventBridge rule, allowing any service that can call PutEvents to request a delayed event at a specified time. A Lambda function was added as an intermediary to upsert schedules, validate payloads, and handle cases where the scheduled time has already passed. The approach was integrated into a shared platform repository, making the scheduling primitive reusable across multiple applications in the same AWS account. The developer noted that while the Lambda layer adds complexity, the tradeoff enables a more flexible and maintainable scheduling experience across their entire app ecosystem.

0
ProgrammingDEV Community ·

Green Dashboards, Angry Customers: Why Infrastructure Metrics Miss the Real Picture

A software engineering team once spent nearly an hour troubleshooting a major customer-facing outage — failed payments, endless loading screens, and social media complaints — while every infrastructure metric showed normal. The root cause was not a server failure but a breakdown in the actual user experience that traditional monitoring tools were never designed to detect. This incident prompted the team to shift from measuring system health to monitoring complete user journeys, such as whether a customer could successfully sign up, search, or complete a purchase. Engineers often default to tracking what is easiest to measure, like CPU and memory usage, rather than what matters most to end users. The key takeaway is that green dashboards reflect infrastructure status, not customer success, and teams that conflate the two risk silent, costly erosions of user trust.

0
ProgrammingDEV Community ·

Google Offers Three Product Visibility Tools Depending on Inventory Type

Google provides three distinct tools for retailers to display products online: Google Business Profile's Product Editor, Local Inventory, and Merchant Center. Businesses selling items without barcodes can manually upload product details and images through the Product Editor, while those with barcode-based stock can automate listings via Local Inventory using UPC or EAN identifiers connected to a point-of-sale system. Merchant Center serves retailers seeking broader distribution across Google surfaces such as Search, Shopping, Maps, and YouTube, including multi-store management. The choice between tools depends on whether a business has standardized product identifiers, requires store-level inventory automation, or wants visibility beyond a single local profile. Importantly, lacking barcodes does not prevent product visibility, as the Product Editor offers a manual entry path for eligible products.

Developer finds distributed systems lessons hidden inside a simple Rock Paper Scissors game · ShortSingh