I've replaced several tank style water heaters over the years just being the family handyman. Moms house, brother's house, in law's, neighbors, and a few of my own. I've had 2 houses of my own over the years about 30 miles from my relatives and my current one is 6 miles from my 1st. When Ive put them in up north for my relatives (again only 30 miles from my place) they last way beyond the warranty rather easily. .
Here I haven't had one last thru the warranty yet. I buy the 12 year ones. Once I got a 9 year ("middle of the road" quality) and it didn't make it to the end of the warranty either. At least the replacements have been free.
In both of my houses I came in to find a 30 gallon tank and upgraded to 40 gallon models. All nat gas models. And un both of my houses the units I removed were removed just because they "looked old" weren't leaking yet. I'm sure the one I p put in this house in 98 replaced the original which was from 1967. And I'm on my 3rd water heater. The last one that went lasted about 7-1/2 years.
. When that one went, I took my replacement credit (which was alot more than I'd paid for the 1st one I'd put in, that 2nd one was also a free replacement for the 1st one I bought) and put it towards an AO Smith wall mount tankless, since they were on a good sale so I didn't have to add much to make up the difference in price between the current value of a 40 gallon tank and the tankless.
My biggest reason for the tankless is that where the water heater was located it is directly in front of the furnace, with not a whole lotta room in between in order to reach the furnace when it needs maintenance. I've had to remove the tank type water heater a couple of times over the years to access the furnace, then Reinstall it. With the tankless off of the ground I have a lot more room to get at the furnace. So far I like the tankless. It's been in place about 2-1/2 years so far and has a 15 year warranty.
Hopefully now that we have "city" water that will make a difference in helping this one to last. Though we had the same source of city water at my old house too.we had well water when I moved here.