Taiuou
Junior Member
Viết tiếng Việt tử tế đi
Chào mọi người e 2k là newbie e đang làm một dự án microservice theo pattern cqrs.
1. Cache key: user:{userId}: value: list friends -> r hit cache 2 lần rồi tính toán -> trả về response.
2. Cache key là user:{userId}:{requestUserId} : value: list mutual friends của 2 users -> hit r trả về response luôn.
- Em thâý Cách thứ 2 khi xảy ra sự thay đổi thông tin ở command side thì update cache rất mệt. mn cho e giải pháp vs
- Cmd side e cho write vô mysql và bắn event qua kafka.
- Read side e dùng mongo để projection và hạn chế gọi internal call giữa các read side và e có dùng redis cache.
1. Cache key: user:{userId}: value: list friends -> r hit cache 2 lần rồi tính toán -> trả về response.
2. Cache key là user:{userId}:{requestUserId} : value: list mutual friends của 2 users -> hit r trả về response luôn.
- Em thâý Cách thứ 2 khi xảy ra sự thay đổi thông tin ở command side thì update cache rất mệt. mn cho e giải pháp vs
Last edited: