I have worked with many types of magnets. Critical is the volume of the required field. If it is just a few mm^3 you may get away with a permanent magnet with a focusing pole piece. If you need more like some cm^3 we're talking about electromagnets, power hungry, big, unstable. If you need cm3...