It is pretty common to for credit card systems to go offline temporarily at grocery stores and restaurants. Always a good idea to have cash.
Because credit-card systems ostensibly don't rely on debiting actual funds, they should be resilient and continue to work offline; when you use EMV (chip+PIN) it's the card that authenticates you and authorizes the transaction, not the bank down a phone-line (and who can forget credit-card imprinter machines?)
I haven't carried enough cash to pay for groceries or dinner at a restaurant in over 10 years.