22. June 2008, 21:03, by Silvan Mühlemann

Round Robin Data Storage in MySQL

If you want to store large amount of volatile data (e.g. log file entries) in a database with a constant storage memory footprint and no maintenance to purge the old entries, a round robin database is the best solution. But how to implement it in MySQL?

Some of the heaviest tables in our database are tables which do some event logging. Let’s look at a table which log the most recent visitors on a member profile. Look at that ugly output:

mysql> SHOW TABLE STATUS like "profile_visits_log" \G;
*************************** 1. row **********************
           Name: profile_visits_log
           Rows: 6'226'066
 Avg_row_length: 21
    Data_length: 130'747'386
   Index_length: 393'205'760

It grows and grows… And the queries get slower and slower.

This is the case because we are keeping a lot of old, unused data. For example, on my member profile there’s data back to September 2007:

Profile visitor list on tilllate.com

So we have to get rid of that old data. For example we can do it like Xing and store the n most recent entries for each user. Drop the rest:

Profile visitors in Xing

Now, how do we do that in the most elegant way?

(more…)

Filed under: Database,PHP
10. June 2008, 15:48, by Leo Büttiker

PHP @ OpenExpo

OpenExpoAt 24./25. of September 2008 there will be the OpenExpo in Winterthur. I will be in charge of the PHP booth. I am looking for PHP-Developers, -Evangelists and -Fanboys (and girls) to help me out.

It’s a great opportunity to help spread PHP, meet open source guys or just hang out with other cool PHP guys. Already on the boat are Harry Fuecks (webtuesday organizer, local-hero and PHP-Book-Author), Lukas Smith (PHP Core Dev and Database Expert), Chregu Stocker (PHP Core Dev, liip CEO and Founder), Silvan Mühlemann (PHP-Evangelist, tilllate CTO and Founder) and, well, me.
(more…)

Filed under: PHP
1. June 2008, 21:15, by Silvan Mühlemann

Unit testing makes coding more fun

“unit testing is a test that validates that individual units of source code are working properly”, that’s what Wikipedia says about unit testing. That’s general knowledge.

But what motivates me even more than the increased software quality is that it saves me development time. This sounds odd as you might believe that TDD means writing more code.

Here’s a real-life example:
(more…)

Filed under: PHP,Programming,Web Development

© 2014 tilllate Schweiz AG - Powered by WordPress