Well this is fun, now i'm deleting them by hand
Category All / All
Species Unspecified / Any
Size 1280 x 949px
File Size 218.8 kB
Listed in Folders
Hmmm - Maybe a mark and sweep for large deletion events? First you need a new database table named deleted emails_03042019 (create a new table for each day). In this, you add the ids of all emails you want to delete when a user clicks the delete button for bulk delete requests. Then hit this server once every few minutes and grab, say, 1,000 emails. Delete these from the original database table emails, and then bulk update the column is_deleted to true on the new emails_03042019 table. Once the days emails have been deleted and the day is over, drop the table emails_03042019 entirely. New rows are about the cheapest thing you can do for a DB, while deleting rows (especially if you have to recalculate all of those indexes) is one of the most expensive. So it's best to spread those deletes out so you don't kill the server maybe and let a kind of garbage collector service do it for you? Update is also expensive, but not nearly as expensive as delete and... we're only doing 1,000 of these every few minutes anyways. Of course, at 300,000 emails, even 1,000 a minute will take the garbage collector 300 minutes, or 5 hours to delete all of those emails.
Reminds me of the time our remote branch DDOS'ed itself when someone emailed a friend. The email contained four high-res images of a cat they found in the alley. By the time the chain had collected multiple "include all" distros the exchange server was dying under the weight of bouncing copies of these images back and forth from the data-center and back.
xD The follow-up to the nightmare asked why it even happened and I vaguely remember someone in the network group saying the traffic for an hour of cat pictures surpassed the average email load on the servers for the past month.
xD The follow-up to the nightmare asked why it even happened and I vaguely remember someone in the network group saying the traffic for an hour of cat pictures surpassed the average email load on the servers for the past month.
FA+

Comments