» Go: Building Event-Driven Microservices with Kafka » 4. Consumer: Recommendation Service » 4.1 Service Design

Service Design

Event Queue

As shown in this diagram, the Recommendation Service consumes “search book“ events from the queue, analyzes them and gives the book recommendations to the users.

Our recommendation service should have at least 3 components:

Recommendation Service Arch

  • Consumer: It consumes events from the queue.
  • API Server: It returns a bunch of book recommendations for a given user.
  • Recommendation Engine: It analyzes1 events and store the result scores in the database.

Footnotes

  1. In production services, you can analyze the data with algorithms like Collaborative Filtering (User-Based, Item-Based), Content-Based Filtering, Matrix Factorization and etc.

PrevNext