In a pan over medium-low heat, add the olive oil and butter and let them melt together. Add the sliced shallots and cook, stirring occasionally. After 5 minutes, season with a pinch of salt and continue cooking for 25-30 minutes, until deeply caramelized.
Add the garlic and the red pepper flakes (if using) and cook for 1 minute, just until fragrant.
Add the ditalini and stir for about 1 minute to lightly toast.
Deglaze with the white wine, stirring and scraping up any bits from the bottom of the pan. Let it simmer until mostly evaporated, about 2 minutes.
Add the broth and bring to a gentle bubble, stirring occasionally so the pasta doesn’t stick. Reduce the heat to low and add the Parmesan rind and thyme. Cook, stirring occasionally, until the pasta is tender and most of the broth has been absorbed.
If using frozen peas, let them thaw while cooking then stir them in at the end, just until warmed through. If using fresh peas, stir them in during the last 2-3 minutes of cooking. Remove and discard the Parmesan rind and thyme, then stir in the grated Parmesan.
Serve and top with more grated Parmesan!