There are two families of code in a plant. Labels give you black-on-white print on a controlled substrate: easy to read, and easy to lose in a wash, an oven or a paint booth. Direct part marks (DPM) are made in the part itself and last as long as it does, which is why engine, implant, aircraft and battery traceability marks the metal, and why DPM is the harder half of this job.
Four ways to mark a part
Dot peen drives a stylus into the surface to make a grid of craters; it survives paint, blast and heat treat, but its contrast comes only from shape and degrades with stylus wear. Laser etch removes material to leave a mark with depth and a dark or frosted look. Laser anneal creates an oxide color change in stainless or titanium with no crevice, which suits medical instruments that get reprocessed. Ink jet prints at line speed with no contact, fine where the code only has to survive to the next station.
Data Matrix, QR, and 1D
For DPM, Data Matrix ECC 200 is the default: a serial number in a few millimeters, Reed-Solomon error correction, and a finder pattern dot peen can reproduce. QR codes are common on labels and need a four-module quiet zone versus one. 1D barcodes still rule cartons but need length a part rarely has and carry no error correction.
The customer spec usually picks the symbol (AIAG B-17 in automotive, AS9132 in aerospace, MIL-STD-130 for US defense, GS1 formats for UDI). You control size, placement and method.