Ion exchange is a water treatment process that removes ions from water through an exchange of ions between a resin and water. There are cation exchange resins that remove positively charged ions and anion exchange resins that remove negatively charged ions. Ion exchange is commonly used for water softening by exchanging calcium and magnesium ions for sodium or potassium ions held on the resin. The resin becomes exhausted over time and must be regenerated by flushing it with a brine solution to restore the ions on the resin.