In the web notification system, how does a message carrier carry information?

Source: Internet
Author: User
Tags notification center
In a message notification system, there are comments and replies: {code ...} considering the scalability, I cannot hard write the notification content to be displayed to the database or redis. I can see the "template" mentioned on the Internet. If I simply call the display template based on the notification type, I don't think so...

In a message notification system, there are comments and replies:

-The display format of each notification on the web Front-end is different.-For the same notification, such as comments, the content of the comments on the web Front-end is different, for example, if you comment on a diary or comment on a photo, the display of the Message notification is different.-In addition, there may be several display formats for the comment of a photo;

Considering the scalability, I cannot hard write the notification content to be displayed to the database or redis. I can see the "template" mentioned on the Internet. If I simply call the display template based on the notification type, I don't think so, but I really don't know how to design a database to meet my above requirements. I don't know how to design such notifications?

Reply content:

In a message notification system, there are comments and replies:

-The display format of each notification on the web Front-end is different.-For the same notification, such as comments, the content of the comments on the web Front-end is different, for example, if you comment on a diary or comment on a photo, the display of the Message notification is different.-In addition, there may be several display formats for the comment of a photo;

Considering the scalability, I cannot hard write the notification content to be displayed to the database or redis. I can see the "template" mentioned on the Internet. If I simply call the display template based on the notification type, I don't think so, but I really don't know how to design a database to meet my above requirements. I don't know how to design such notifications?

Provide a solution:
The notification does not contain specific content or contains the minimum amount of necessary information (suchMessage count,SenderWhen the user clicks, the user obtains the specific message content asynchronously.

Take Android push as an example. This is an implementation of our first product. The notification type and user ID are passed, and then pushed to the notification center after resolution is complete. Similar to the preceding description, a minimum amount of necessary information is carried, and the specific content is obtained asynchronously.

Let's talk about how to present the specific notification information.
First, the information stored in the storage must not be the information that is finally presented to the user. The information presented to the user should be assembled at the service layer or on the page. Store or save basic data information, such as the comment content, time, and image link.

The idea was not clear last night. Now let's make a supplement.

The method mentioned above is 1. There is also a message format agreement with the view layer (web, app), and then inserviceLayer to complete message assembly.
Take iOS push as an example: Because iOS push follows Apple's APNs protocol, alter is alter, badge is badge, and the push needs to be passed to the app, It is encapsulated in custom. The web can also be similar, Protocol specific notification format, and then judge and present at the web layer.

This is what I do now. The information to be pushed to users now,
This information is divided into various types. What if redis is used for storage? In addition, how does one read the message records that the user has not read ??

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.