The webservers should be treated as if they're potentially compromised, not given arbitrary access to a database...
Specifically: if you're working with a lot of very sensitive information, you structure your application such that there are multiple layers separating that data from the outside world. In the case of Equifax, that might mean implementing the "credit score check" as an internal service exposed through the public web servers (or whatever).
* Credential vaults that allow only-once retrieval on application startup and only keep credentials in memory
* anomaly detectors for request patterns (suspicious payload formats, processing time, CPU/memory usage, etc),
* Honeypot records in sensitive data stores (records you know should never be accessed, if they are you've been breached)
If you're storing information this sensitive you need to be paranoid, because an attacker has a $4B incentive ($30/identity on the black market * 143 million records) to crack your systems.
It seems amazing that nothing tripped up some monitoring or something.
Not really accurate because the exploit name, especially as generic as RCE, does not tell you how it was done. RCE can be a number of things that can be fixed in numerous ways. For example, file upload functionality with path manipulation and no file type validation may lead to RCE. This can certainly be removed with properly crafted file upload handling.
Some RCE, particularly on lower layers of the application stack, may be more difficult to defend against, especially in the case of unknown exploits.