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
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
You can consider using ElasticSearch