Performance & Scalability
Large chunks of code should be pre-loaded in libraries. Code in BML pages is re-evaled on every request, so it should be small. If you need a lot of code, put it in a library and load it in cgi-bin/lj-bml-(init|local).pl
Don't write temporary files to disk… all LiveJournal code should be able to run on a cluster of web servers with no disk-based session persistence.
If you are calling a function with a
$dbarg parameter and you have both a
call the function with your
$dbs … otherwise the function and all its callees can't ever use the slave databases.