Flink-Based Real-Time Recommendation System Architecture and Deployment Guide
This article presents a comprehensive overview of a Flink-powered real-time recommendation system, detailing its v2.0 architecture, module functions, recommendation algorithms, front‑end and back‑end interfaces, Docker‑based deployment of MySQL, Redis, HBase, Kafka, and step‑by‑step startup procedures.
The article introduces a Flink recommendation project hosted on GitHub and explains the motivation for sharing a practical, source‑code‑included example.
1. System Architecture v2.0 includes a diagram (omitted) and module descriptions:
Log data module (flink-2-hbase) with six Flink jobs handling user‑product browsing history, user interest, user profile, product profile, hot‑list, and log import, storing results in HBase tables (p_history, u_interest, user, prod, redis, con).
Web module provides a front‑end page showing recommended product lists and a back‑end monitoring page for administrators.
2. Recommendation Engine Logic
2.1 Hotness‑based recommendation : Re‑ranks the hot list according to user features and combines it with relevance scores from two algorithms.
2.2 Product‑profile similarity : Uses three product attributes (color, country, style) and cosine similarity to compute item‑to‑item scores.
2.3 Collaborative‑filtering similarity : Calculates similarity scores from the user‑product table in HBase.
3. Front‑end Recommendation Page displays three columns: hot‑list, collaborative‑filtering, and product‑profile recommendations.
4. Back‑end Dashboard shows real‑time metrics such as hot‑list and hourly log ingestion, with data stored in resource/database.sql.
5. Deployment Instructions (Docker based):
MySQL: docker pull mysql:5.7 and
docker run --name local-mysql -p 3308:3306 -e MYSQL_ROOT_PASSWORD=123456 -d mysql:5.7Redis: docker run --name local-redis -p 6379:6379 -d redis HBase: pull harisekhon/hbase and run with multiple port mappings (2181, 8080, 8085, 9090, 9000, 9095, 16000, 16010, 16201, 16301, 16020) and --name hbase.
Kafka: pull Zookeeper and Kafka images, start Zookeeper, then start Kafka with appropriate links and environment variables, and optionally run Kafka‑Manager.
6. Service Startup Steps include configuring IPs/ports in the Flink and web services, building the Flink module with mvn clean install, launching Flink tasks, starting the SchedulerJob for periodic scoring, and finally running the web project.
7. Next Work suggests adding Flink task monitoring, enhancing the dashboard, and measuring recall/precision metrics.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Architect
Professional architect sharing high‑quality architecture insights. Topics include high‑availability, high‑performance, high‑stability architectures, big data, machine learning, Java, system and distributed architecture, AI, and practical large‑scale architecture case studies. Open to ideas‑driven architects who enjoy sharing and learning.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
