Re: Security is hard
In this case, and yesterday's, the security is actually really simple - don't put your backend database on the Internet.
Yes it means your cut-and-paste from stackexchange web developers might have to do some basic architectural design but it's not hard.