English 中文(简体)
如何制定搜索订阅系统?
原标题:How to code a search subscription system?

我有一个市场网站,包括学生住房清单。 我想请我的用户做一个特别的查询,然后能够“登记”,也就是说,如果新房的列名与具体询问相匹配,他们就会收到电子邮件。

怎样才能做这样的事情? 到目前为止,我知道两种选择:

  • Checking for matched subscriptions when the listing is posted - wouldn t this significantly increase processing time for the user posting the listing if there are thousands of matched subscriptions and it has send thousands of emails?

  • Using a CRON job to check all subscriptions against matched listings - I m guessing this is slightly more tricky

你会提出什么办法? 我赞赏一些指导/投入。

最佳回答

I ve worked on projects similar to what you are discussing. I ve found that it s best to use the CRON approach, and here s why:

You don t want to bombard the user with spam mail several times a day (when a new listing is posted), rather you want to focus on once a day or even once a week, to reduce the chance the user will unsubscribe.

You can schedule the CRON to run the script during off-hours when your system isn t under heavy load as you will need to step through all the users who signed up for your service, then check to see if any new inventory was added that match their search criteria.

当然,所有这一切都假定你制定了法典/法令,以促进CRON的解决办法。

问题回答

我将承担一些任务(例如,一个跳板),即每个用户(星期天)对新名单进行自动核对,以适应他们的偏好。 每次张贴新名单时,你都不想这样做,因为这有一些缺点。

  1. You need to find the users that are interested in the particular listing, a much more complicated task than the other way around
  2. As a user, there s a risk of receiving a lot of e-mails during the day. I think you d rather have a [daily|weekly|monthly|hourly] digest.




相关问题
SQL SubQuery getting particular column

I noticed that there were some threads with similar questions, and I did look through them but did not really get a convincing answer. Here s my question: The subquery below returns a Table with 3 ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

php return a specific row from query

Is it possible in php to return a specific row of data from a mysql query? None of the fetch statements that I ve found return a 2 dimensional array to access specific rows. I want to be able to ...

Character Encodings in PHP and MySQL

Our website was developed with a meta tag set to... <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> This works fine for M-dashes and special quotes, etc. However, I ...

Pagination Strategies for Complex (slow) Datasets

What are some of the strategies being used for pagination of data sets that involve complex queries? count(*) takes ~1.5 sec so we don t want to hit the DB for every page view. Currently there are ~...

Averaging a total in mySQL

My table looks like person_id | car_id | miles ------------------------------ 1 | 1 | 100 1 | 2 | 200 2 | 3 | 1000 2 | 4 | 500 I need to ...

热门标签