How to design a subscription system? is the keyword search the title of the kind, this need search engine? Or is there any other way?
Source: Internet
Author: User
KeywordsPhpmongodbmysqlnode.jsjava
Title, how to design a subscription system, is the kind by keyword, such as the subscription "small three" news title contains "small three" are to get out, and then subscribe to the "Apple" and then the title contains Apple's give out ... So it might be designed to exclude certain words,
If you use a database like words, resources must be very expensive, to ask how the maturity of the procedure is how to do? and how to publish different results to different subscribers?
Reply content:
Title, how to design a subscription system, is the kind by keyword, such as the subscription "small three" news title contains "small three" are to get out, and then subscribe to the "Apple" and then the title contains Apple's give out ... So it might be designed to exclude certain words,
If you use a database like words, resources must be very expensive, to ask how the maturity of the procedure is how to do? and how to publish different results to different subscribers?
Ask the master to describe the problem in detail first
What are the sources of these news? UGC? Crawl?
How large is the news? Million? Million?
To crawl information, news, tens of thousands of levels for example, roughly divided into a few parts: 1. The captured news will have a classification module for each item labeled after the storage 2. In order to access the speed, maintain a label in memory-news unique ID array data structure, you can use Redis can also write a single service 3. There will be a table to maintain user and subscription topics 4. When the user sends a request to obtain a message, go to memory according to the request of the inscription to the memory to get the latest news ID, according to the ID to go to the database to retrieve news, anti-concurrency on the database to add a layer of cache
If it is a search engine is in memory maintained an inverted index table, each news in the storage before the data will be cleaned, cut words into the table, then the user query keywords will be based on the index in the table to find a specific number of entries returned
Above
Kafka system Ah, publish & Subscribe to the messaging system
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.