Preheat the oven to 350°F. Grease two 9-inch cake pans and dust them with cocoa powder instead of flour, shaking to coat the bottom and sides. Tilt the excess into the second pan as you go.
Whisk together the flour, baking soda, baking powder, and cocoa powder in a bowl. Use the dip-level-pour method for the flour so it isn't packed.
In a mixer bowl, combine the sugar and vanilla. Add the eggs one at a time, mixing after each.
Turn the mixer to high and beat for a full 3 minutes, until pale and fluffy.
Add the mayonnaise and mix on low just until blended.
Add the dry ingredients and water alternately in about three additions each, starting and ending with the dry ingredients. Mix on low and stop as soon as the batter comes together — do not over-beat.
Scrape down the sides of the bowl and mix briefly to incorporate.
Divide the batter evenly between the prepared pans and shake gently to release air bubbles.
Bake at 350°F for about 30 minutes, checking at 28, until a toothpick inserted in the center comes out clean.
Cool in the pans for 10 minutes, then turn out onto racks and cool completely before icing.