I work on a social network like a subset of Facebook. I think this means the application will be more difficult to read than a heavy record (i.e. More SELECT than INSERTS, UPDATES or DELETES)
I plan to use MySQL for the database using MyISAM. Each table in the database will contain the following three fields:
CREATED - date field containing the time the record was createdUPDATED - date field containing the time when the record was changed.ROWSTATUS - CHAR field (1) containing one character of the character to indicate whether the record is active, inactive or deleted (using the values ββ"A", I and D respectively).
Through the PHP wrapper class, we ensure that all SELECT queries include ROWSTATUS queries, and UPDATE also updates the updated column, and INSERT queries update the CREATED column.
I plan on not actually deleting the entries, rather than updating by writing the ROWSTATUS field to D to show that it has been deleted (i.e. soft deletion).
We have an SQL procedure that physically deletes deleted data after 10 days.
However, I survived this article , which states that there is no need to physically delete it due to blocking overhead. Rather, the author suggested using this scheme:
SELECT e.eventid,e.title FROM events e WHERE NOT EXISTS (SELECT * FROM event_deletes ed WHERE ed.eventid = e.eventid);
I am wondering how my circuit compares with this proposed mechanism, and which is better? I could not reach for any final answer on my own.
source share