Erythromycin is a type of antibiotic known as a macrolide, which is often prescribed to people with penicillin allergies. Macrolides are a separate family of antibiotics. While penicillin was produced from Penicillium fungus, erythromycin is actually produced by a particular species of bacteria, Saccharopolyspora erythraea.
Penicillin was the first type of antibiotic to be discovered and mass-produced. It was discovered by accident when a researcher discovered that fungal spores contaminating bacterial cultures in his laboratory appeared to be rapidly killing off the bacteria. Today, several variants of penicillin exist, some of which are produced synthetically rather than through fungal cultures. It is a beta-lactam antibiotic, a type of antibiotic which attacks bacteria's ability to form their defensive cell walls. This weakens the cellular wall to the point that it collapses and dies.
Penicillin is still widely used today, especially as a first treatment common infections like strep throat. However, decades of common use has allowed many types of bacteria to develop resistance to penicillin, so that the drug often proves useless. In addition, around 1% of patients will experience significant side effects when taking penicillin, including a fever, vomiting, a skin rash, diarrhea, and in rare cases even seizures.
Because of penicillin's shrinking usefulness and particularly for patients who have had a bad reaction to penicillin in the past, doctors may prescribe erythromycin instead. Erythromycin was discovered in the late 1940s in a set of soil samples in the Philippines. Unlike penicillin, researchers still do not fully understand how erythromycin works, but it appears to block certain vital portions of bacterial DNA responsible for cellular reproduction. This is a quite different mechanism of action than penicillin, and this, combined with the different origin and chemical makeup, is why erythromycin is not classified as part of the penicillin family.
As with penicillin, some people taking erythromycin may experience side effects like stomach pain, nausea, and diarrhea. Just as some people are allergic to penicillin, other people will be allergic to erythromycin. According to the National Institutes of Health, people taking erythromycin should report serious or persistent stomach pains, diarrhea, nausea, or skin rashes to their doctor. If this turns into hives, jaundice (which turns the skin and the eyes yellow), or trouble breathing, seek immediate medical attention.
The National Institutes of Health maintains a penicillin side effects fact page as well as an erythromycin side effects facts page. If you are taking either antibiotic, you should discuss dosage and potential side effects with both your doctor and your pharmacist, who can give you professional medical advice.