Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT]: GET /api/v1/blogs/{blog_id}/engagement #1136

Open
0x00whitecode opened this issue Feb 28, 2025 · 0 comments
Open

[FEAT]: GET /api/v1/blogs/{blog_id}/engagement #1136

0x00whitecode opened this issue Feb 28, 2025 · 0 comments

Comments

@0x00whitecode
Copy link

Why?
Monitors engagement metrics, including views, likes, and comments.
Enables authors and administrators to assess a blog post's popularity.
Can be utilized for recommendation systems, such as suggesting blogs with high engagement.

What?
Returns engagement data for a specific blog post:
Total Views
Total Likes
Total Comments
Shares (if applicable)

How?
Store views separately from likes and comments

Views should not be updated in real-time via database writes to avoid performance issues. Instead:
Use a caching system (Redis) to store views temporarily.
Batch update views periodically to the database.

  • Use efficient counting strategies for likes and comments

SQL: Use COUNT(*) on indexed columns.
NoSQL (MongoDB): Maintain a separate collection for analytics to avoid scanning large comment or like datasets.
API Response Example:

json

{
  "blog_id": "123",
  "views": 2450,
  "likes": 150,
  "comments": 25,
  "shares": 10
}
@0x00whitecode 0x00whitecode changed the title [FEAT]: GET /api/v1/blogs/{blog_id}/stats [FEAT]: GET /api/v1/blogs/{blog_id}/engagement Mar 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant