Heat olive oil in a large heavy saucepan over medium heat. Fry shallots until softened. Stir in onion and bacon, and cook until bacon is evenly browned. Stir in garlic when bacon is about half done. Remove from heat.
Bring a large saucepan of lightly salted water to a boil. Add pasta and cook for 8 to 10 minutes or until al dente. Drain pasta, then return it to the pan.
In a medium bowl, whisk together egg yolks, cream, and shredded Parmesan. Pour the bacon mixture over the pasta, then stir in the cream mixture. Season with salt and pepper.