M
M
Mikeprosoft2011-04-15 16:00:14
PHP
Mikeprosoft, 2011-04-15 16:00:14

Implementing an Activity Feed?

There was a task - to develop a user activity feed as in social networks.
Googling only led to this example: www.instantcms.ru/wiki/doku.php/development : components: activity_tape Tell me
, who implemented it, how to design this module correctly? As described in the article, or can write a large query on all tables and create a cache for each user?
Just judging by that example, it does not take into account, for example, changing content, determining the amount of content added (for example, 7 photos were added, etc.)

Answer the question

In order to leave comments, you need to log in

3 answer(s)
P
Pavel Chipak, 2011-04-15
@reket

1) Group by time intervals, but the big minus is the load on the database.
2) Denormalization (what I would choose).

K
Kirill Dlussky, 2011-04-16
@Dlussky

What is the main problem for you? If in performance - make several redis servers with a choice by user range. Very reliable and very fast.

Y
yadeveloper, 2011-04-16
@yadeveloper

If your project involves a large load, I would recommend using trigger implementation logic (this is perhaps one of the few cases when it really makes sense to put the business logic of an application in the database).
First, understand what formula will be used to calculate your rating. Let's say this formula has 5 components. The formula is simple and can be calculated on the fly (although here you can also force recalculation by trigger, this is the right option).
The user adds a photo - the component of the formula (a field in the database) is incremented, the trigger twitches - the total result is recalculated. The user rated someone's photo (wrote a comment etc) - the same logic, but a different field.
To begin with, we decided by what criteria you will calculate the final numbers, logically break the components into modules (which you have in the system) and determine the formula. This is perhaps the most difficult task

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question