How to design a subscription system? It depends on the keyword search title. Does this need a search engine? Or is there any other method?

Source: Internet
Author: User
For example, how to design a subscription system depends on keywords, such as subscription & quot; Tips & quot; news titles include & quot; Tips & quot, subscribe to & quot; apple & quot; and then include the title of apple... in this case, some words may need to be designed and excluded. If the database LIKE is used, the resources will definitely consume a lot. I 'd LIKE to ask... for example, how to design a subscription system depends on key words, for example, subscribe to "S3." news headlines include "S3, subscribe to "apple", and get the title containing apple... this may also require the design to exclude certain words,

If you use the database LIKE, the resources will definitely consume a lot. Would you LIKE to ask how the mature practices are achieved? How do I publish different results to different subscribers?

Reply content:

For example, how to design a subscription system depends on key words, for example, subscribe to "S3." news headlines include "S3, subscribe to "apple", and get the title containing apple... this may also require the design to exclude certain words,

If you use the database LIKE, the resources will definitely consume a lot. Would you LIKE to ask how the mature practices are achieved? How do I publish different results to different subscribers?

Please give a detailed description of the problem.

  • What are the sources of these news? UGC? Capture?

  • How many of these news? Millions? Tens of millions?

Taking capturing information, news, and tens of millions of data records as an example, the data can be divided into the following parts:
1. the captured news will contain a classification module that tags each entry and then stores it into the database.
2. Maintain the data structure of a tag-unique news ID array in the memory for access speed. You can use redis or write a service separately.
3. There will be a table to maintain users and subscribe topics
4. when a user sends a request for obtaining a message, the user goes to the memory to obtain the latest news IDS Based on the Request's question, and then obtains the news and returns the news from the database based on the ID, add a cache to the database for anti-concurrency

If it is a search engine, an inverted index table is maintained in the memory. Every news item will clean the data and cut words into the table before it is written into the database, then, the user queries the keywords and returns several specific entries Based on the index in the table.

Above

Kafka system: publish and subscribe message system

ElasticSearch

Related Article

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.