Bring water to a boil, add generous salt and add the corn. Cover the pot and cook the corn for about 10 minutes.
Remove the cobs from the water (keep the water) with a slotted spoon. Once the cobs are cooled down a little, grate the corn with a box grater (don’t throw the cobs away).
Mince the shallot and chop the small tomatoes in half or in quarters. Add some salt and pepper to the tomatoes.
Bring the water in which you cooked the corn back to boil, add the ’empty’ cobs and the pasta and cook the pasta according to the directions on the packaging.
Heat a tablespoon of butter in a skillet, add the shallot and the grated corn, as well as the red pepper flakes and add about 1/2-1 cup of pasta water and cook until the mixture starts to thicken (approx. 10 minutes).
Drain the pasta, transfer the pasta and the tomato halves to the onion/corn skillet and stir. Cook a few minutes and the sauce will cling to the pasta.
Stir some butter into the pasta. Season with salt and pepper if needed.
Serve and sprinkle with chopped basil.
Notes
Select a pasta shape that holds on to sauce easily. That's pasta with twists or witha ribbed surface (rigata).