Both kinds exist. Both have different benefits and drawbacks.
You shouldn’t only be using one type in your house.
Optical is great for detecting large smoke particles quickly. If the smoke is small particles, though, it’ll need to be rather dense before it’ll go off. Ionizing detectors have the opposite issue; they react quickly to small particles but can’t detect large particles that well.