If anyone says to you that a battery is only supposed to last 2 years and no more, it's a ridiculous myth perpetuated by battery sellers to increase margins and sell crap quality batteries prepared with tap water and impure acid.
I have two Daewoo maintenance-free batteries that are 3.5 years old each and cranking strong - these are reputed to be of shoddy construction, but as long as they are correctly charged and do not lose electrolyte they can last.
Your alternator and its charging voltage is an important piece of the longevity puzzle.