Ferroelectricity at the nanoscale