I recommend only writing when it is necessary, so e.g. you might want to log to /dev/null or tmpfs (I chose the latter but it adds up in RAM). Also, disable swap if at all feasible.
On top of that I recommend industrial grade SD cards using (a)MLC. They might be a bit more expensive but it is worth the stability.
I learned this from these posts (among others in the same thread 'Raspberry Pi microSD card performance comparison') [1] [2]