Self-service key machines and mail-order duplication services are now common, and they vary widely. The convenience is real, and so is the quality problem: a machine that copies the key you feed it will faithfully copy its wear as well, and an online service works from a photograph or a code you supply.
If you use one, keep the original as the master and check the new key in the lock before you need it. Test it from outside, with the door closed, rather than assuming it works because it fits. A key that turns on a bench but binds in a cold exterior lock is a key that will let you down on a January evening. If a service keeps a record of your key code so future copies can be ordered, ask how that record is stored and who can request a key against it, because a code held on file is itself a form of access to your home.
Where copies must stay under control, restricted keys use a registered keyway that ordinary key-cutting counters cannot duplicate.