I am using redis sorted sets
to save user notifications. But as i never did a notification system, I am asking about my logic.
I need to save 4 things for each notification.
- post_id
- post_type - A/B
- visible - Y/N
- checked - Y/N
My question is how can I store this type of structure in sorted sets?
ZADD users_notifications:1 10 1_A_Y_Y
ZADD users_notifications:1 20 2_A_Y_N
....
There is a better way to do this type of stuff in redis? In the case above i am saving the four thing in each element, and i need to split by the underscore in the server language.