3 ms·
Death by design doesn't work for everything (which is why I hope your database server and your filesystem aren't written in PHP), but it's a great fit for handl
by toast0 14y ago
Death by design doesn't work for everything (which is why I hope your database server and your filesystem aren't written in PHP), but it's a great fit for handling HTTP requests that are shunting data around.
You can, and probably should, use other languages to process data in batches, and whatever maintenance needs to be done. It would be nice sometimes to be able to finish a client request, and then continue to do more work, you can approximate that by forking a background task (hopefully with some sort of limit to avoid crushing your machine), or a call to a task daemon.
Knowing that the PHP process lifecycle is very short helps you prioritize things too. Do you really want to spend time making a giant object oriented representation of your relational database, when you're just going to throw it away in 50 ms; wouldn't you rather spend more time with your kids?