1. DATABASE-SPORT
DATA SPORT
  • DATABASE-SPORT
    • Tổng quan
    • Logic
      • Logic tổng thể
    • Projects
      • Yêu cầu hệ thống
      • Architecture
        • Database
    • Public APi
      • Tổng quan
    • Cron Make File
      • Tổng quan
  • GOLANG-THESPORT
    • Tổng quan
    • Architecture
      • System
      • Database
      • Source Code
    • Development
      • Local
      • Production
  • GOLANG-KSPORT
    • Tổng quan
    • Architecture
      • System
      • Database
      • Source Code
    • Development
      • Production
  • CRONJOB-LARAVEL
    • Tổng quan
    • Logic
      • Logic tổng thể
    • Projects
      • Yêu cầu hệ thống
      • Architecture
        • System
        • Source code
        • Database
      • Development
        • Dev
        • Production
      • Public API
        • Common API
          • League & Cup Profile (Basic)
          • Schedule & Results (Basic)
          • Match Modify Record
          • List of Countries
          • List of Bookmakers
          • Configuration instructions
        • Live animation
          • Configuration instructions
          • Schedule & Results
        • Live Data
          • Livescores for Today
          • Livescores Changes
          • Schedule & Results
          • Schedule Changes
          • Events
          • Stats
          • Corner
          • Lineups
          • Injury
          • Match List of Live Text
          • Live Text
          • Transfer
        • Profile
          • League & Cup Profile
          • Subleague Profile
          • Cup Stage Profile
          • Team Profile
          • Team Profile Copy
          • Team Profile for Search
          • Player Profile
          • Player Profile for Search
          • Referee Profile
          • Teamlist with Player Profile
        • Stats
          • Matches Analysis
          • List of Player Stats (Match)
          • Player Stats (Match)
          • List of Player Stats (League & Cup)
          • Player Stats (League & Cup)
          • League Standing (Get Subleague)
          • League Standing
          • Cup Standing
          • Top Scorer
          • FIFA Ranking
        • Odds (18 bookmakers)
          • Pre-match and In-play Odds (Main)
          • Live Odds Changes (Main)
          • Historical Odds (Main)
          • Future Odds (Main)
          • Pre-match and In-play Odds (All)
          • Live Odds Changes (All)
          • Historical Odds (All)
          • Future Odds (All)
          • European Odds (Halftime)
          • In-play Odds
          • In-play Odds (Halftime)
          • Odd Modify Record
        • European Odds (200+ Bookmakers)
          • European Odds (200+ Bookmakers)
        • Other Odds
          • Outrights
          • First/Last Team To Score (pre-match)
          • Goals Odd/Even (pre-match)
          • Goals Odd/Even (In-play)
          • Number of Goals in Match (pre-match)
          • Number of Goals in Match (In-play)
          • Half Time/Full Time (pre-match)
          • Half Time/Full Time (In-play)
          • Correct Score (pre-match)
          • Correct Score (In-play)
          • Half Time Correct Score (pre-match)
          • Half Time Correct Score (In-play)
          • Handicap Corners (pre-match)
          • Handicap Corners (In-play)
          • Total Corners (pre-match) - Tổng phạt góc trước trận đấu: First Odds
          • Total Corners (In-play) - Tổng số quả phạt góc (Trong trận) - Run Odds
          • Double Chance(pre-match)
          • EuroHandicap(pre-match)
  • GOLANG-WEBSOCKET
    • Tổng Quan
    • Logic
      • Logic tổng thể
    • Projects
      • Yêu cầu hệ thống
      • Architecture
        • System
        • Source code
      • Development
        • Dev
        • Production
      • Public API
        • API
  • ADMIN-BANNER
    • Tổng quan
    • Logic
      • Logic tổng thể
    • Projects
      • Architecture
        • System
        • Source Code
      • Development
        • Develop
        • Production
      • Public API
        • API
      • Database
        • Cấu trúc Database
      • Admin FE
        • HƯỚNG DẪN CÀI ĐẶT MÔI TRƯỜNG DỰ ÁN SPORT ADMIN
        • Hướng dẫn Đăng nhập
        • QUẢN LÝ SITE (SITE MANAGEMENT)
        • QUẢN LÝ GIẢI ĐẤU (LEAGUE MANAGEMENT)
        • QUẢN LÝ NHÀ CUNG CẤP (SUPPLIER MANAGEMENT)
        • TIP & CHUYÊN GIA - TAB QUẢN LÝ TIPS (TIPS MANAGEMENT)
        • WHITELIST
        • QUẢN LÝ MINIGAME (MINIGAME MANAGEMENT)
        • TRAFFIC REPORT
        • TOOLS - RAPID DATA
        • TOOLS - LIVE SITES
        • TOOLS - SUPPLIERS
        • THEME / PLUGIN
        • NGƯỜI DÙNG - PHÂN QUYỀN VÀ HIỂN THỊ (PERMISSION & DISPLAY MANAGEMENT)
        • QUẢN LÝ NGƯỜI DÙNG (USER MANAGEMENT)
        • NGƯỜI DÙNG - QUẢN LÝ NHÓM QUYỀN (ROLE GROUP MANAGEMENT)
  1. DATABASE-SPORT

Tổng quan

TỔNG QUAN CẤU TRÚC DATABASE#


1. Mục đích#

Tổng Quan Cấu Trúc Hệ Thống Dữ Liệu
Hệ thống database vừa có khả năng lưu trữ dữ liệu lớn từ từ API, vừa đảm bảo dữ liệu cung cấp cho Frontend và Public API
1.
Phân Tầng Lưu Trữ (Data Layering)
Raw Data Layer (Staging): Dữ liệu thô từ các nhà cung cấp (như Isport hoặc TheSport) được lưu trữ vào các bảng trong cơ sở dữ liệu
Core Database (Source of Truth): Sử dụng RDBMS (MySQL) với cấu trúc Schema chuẩn hóa. Đây là nơi lưu trữ dữ liệu sau khi đã được mapping, chuyển đổi và làm sạch. - Việc sử dụng Indexing chuyên sâu và Partitioning theo thời gian để duy trì tốc độ truy vấn.
2.Để đảm bảo an toàn và hiệu năng cho đối tác, hệ thống sử dụng các bảng Read-Only Replicas. Điều này tách biệt hoàn toàn luồng truy vấn của người dùng Public với luồng ghi dữ liệu từ công việc đồng bộ (Cronjobs), tránh tình trạng nghẽn cổ chai (Database Locking).
3.
Luồng Xử Lý Dữ Liệu (Data Pipeline)
Hệ thống vận hành theo mô hình hướng sự kiện:
Collector: Các Worker lấy dữ liệu từ Provider API.
Transformer: Mapping dữ liệu vào cấu trúc chuẩn của hệ thống.
Broadcaster: Sau khi lưu vào DB, hệ thống sẽ đồng thời cập nhật Cache và đẩy dữ liệu qua WebSockets để Frontend hiển thị thời gian thực.

3. Tổng kết#

Hệ thống được thiết kế theo hướng:
Xử lý bất đồng bộ
Khả năng mở rộng cao
Tối ưu hiệu suất với cache
Phân tách dữ liệu theo từng loại storage

4 Tài liệu này giúp:#

Hiểu kiến trúc hệ thống
Setup môi trường nhanh
Vận hành ổn định
Modified at 2026-03-25 07:12:40
Next
Logic tổng thể
Built with