On Monday night, political enthusiasts across America waited for votes in the Iowa caucuses to be tabulated. And waited. And waited some more. Because of an ill-designed and poorly tested app, precinct captains couldn’t transmit their vote totals to the tabulators. This was embarrassing for Democratic Party officials and their technology vendor, but it was far from the worst thing that could have happened. In the end, the results will be tabulated correctly. Democracy worked, if a bit more slowly than some might have preferred. But a much bigger failure is still possible, and we’re still not properly prepared for it. The good news is that the problem in Iowa manifested in the tabulation of votes across precincts, which is the easiest part of an election to secure. There was ample public evidence of the vote count in each precinct: Voters filled out paper ballots, and precinct captains conducted public head counts. The rest — adding up votes and calculating delegate counts — is just arithmetic that candidates, journalists and citizens can replicate for themselves. The count went on, it just went didn’t go on as quickly as expected. What we need most from our election systems is resilience. Even in the absence of a cyberattack, things will go wrong. A resilient system can detect problems, recover and reconstruct the accurate result from solid evidence. That’s what we saw in Iowa. Voters made their intentions clear, and the in-precinct paper ballot count was low-tech and public — as resilient as one could hope for. When something went wrong, officials fell back to a verifiable solution. The system worked, even if the app didn’t.