Backend March 2023

6 Game Systems

Providing game interfaces for third-party platform integration, handling 2+ million records using Redis pipelining with Laravel Queue

6 Game Systems

Project Overview

Providing game interfaces for third-party platform integration and subsequent operations. Handling over 2 million data records, using Redis pipelining combined with Laravel Queue for lottery processing and historical record queries.

Project Type: Game Backend System

Development Time: March 2023

Core Technologies: Laravel, Redis, GCP

Data Scale: 2M+ Records

Game Count: 6 Games

Core Features

Game Interface & Lottery System

Providing 6 game interfaces for third-party platform integration, supporting real-time lottery result display, historical record queries, and more. The frontend interface is clean and intuitive, offering a smooth gaming experience that ensures players can quickly understand game rules and participate.

Game Interface Display

Main interface and lottery results display for 6 games

Backend Management System

Providing comprehensive backend management features, including game data statistics, lottery record queries, user management, and more. Through visual charts, real-time monitoring of system operations assists the operations team in quickly understanding game data and user behavior.

Backend Management System

Game backend management and data statistics

Historical Records

Lottery results and history query interface

API Docs

Swagger API documentation and testing tools

Technical Highlights

🚀 High Performance Data Processing

Handling over 2 million records, using Redis Pipelining for batch processing, packaging multiple commands into a single request to significantly reduce network latency. Combined with chunk-based batch processing mechanisms to avoid memory overflow issues, ensuring stable system operation.

Redis Pipelining Process

Processing massive data with Redis Pipelining

⏰ Asynchronous Background Processing

Lottery calculations are time-consuming, so Laravel Queue is used to place tasks in a queue for background asynchronous processing. Fixed batch execution at night avoids impacting daytime user experience, with Queue monitoring ensuring all tasks complete correctly.

Laravel Queue Background Processing

Background queue processing for lottery updates

💾

Smart Caching Strategy

Pre-calculating and caching historical data to Redis drastically reduces database query load and improves query speed

📊

Pagination Optimization

Using Cursor-based Pagination provides a more stable big data pagination experience, avoiding traditional pagination performance issues

Backend Technical Details

Big Data Processing

Handling over 2 million records (as of writing), using Redis pipelining combined with Laravel Queue to process lottery results and query historical records.

Background Processing Mechanism

These games take longer to process lottery results, so all lottery events are placed in a Queue and updated at a fixed time during the night.

Cache Optimization Strategy

Since both frontend and backend need to query historical records, to avoid constant database queries, historical records are pre-stored in Redis.

However, since the historical data update is quite large, pipelining combined with chunking is used for processing.

Database Optimization

For database historical record queries, Cursor-based Pagination is also used, significantly improving query performance.

GCP Technical Details

This project was my first time using GCP, utilizing EC2, Static IP, Cloud SQL, Domain... relatively basic features. Through this experience, I established a foundational understanding of Google Cloud Platform, laying the groundwork for more complex cloud architectures.

Technologies Used

Server

  • GCP (Google Cloud Platform)
  • EC2 Instance
  • Static IP
  • Cloud SQL

Backend

  • Laravel Framework
  • Redis (Pipelining)
  • Laravel Queue
  • Cursor-based Pagination

API Documentation