I play both D3 and Sonic and its one of my favorite matchups because it can go either way. As sonic, I bait the tilts, especially F tilt, then counterattack with spin combos, I grab often and the main goal was to keep him grounded.
In order to stop sonic with D3, you have to use moves that make his spins, as useless as possible. In a normal situation, tilts and Waddles work well. but the problem is that when Sonic begins to mix it up with the aerial versions and thier cancels, stopping his approach becomes very very hard to anticipate. For example, He can quickly short hop over f and D tilits, Do an Aerial Spin Charge, then decide whether to spin normally into you, spin into you then jump with/wo aerial, or shield cancel the spin and grab you.
Also, Sonic's grab game is about as good as D3, becuase of the cancels he has for both spin charge and dash. plus he can tech chase well, better than D3. Im actually afraid of a good sonic player on knockdown, because regardless of how you respond, his speed lets him get you anyway. and to make matters worse, his spins can cancel into grabs almost instantaniously.
Sonic can escape the chain grab by DI ing back, then using the Spring Jump before you can grab him again.
If sonic plays outside of f tilt range, baits a tilt, and does several spin dash combos, that's at least 30% everytime folks.
In the air, Sonic can live there is he avoids the bair for the most part. then if he can suprise D3 with fairs and the speed they come out. both can gimp each other pretty good too.
but sonic has to be smart with the spins, or he can get grabed out of it. I would give it the slight edge to Sonic though. But D3 is easier to learn so it may be awhile before we see sonic's true potential, whereas we already know D3 can be gay.