We don't see many electric tanks, but when we do they are often over 20 years old. IMO, the tanks tend to last longer because they are not subjected to the heating/cooling cycles of a gas burner model.
I tend to think of an appliance a bit like I do an automobile. There is a time to fix it and a time to replace it. It's not always clear when a good time to replace it might be, as the new stuff is generally not of the same quality of the older stuff.