Do i need to book tickets for palazzo vecchio online ?
No, buy there.
You must not do it, but just realize that Florence is one of the most visited cities in Italy and probably in Europe, so specially in high seasons the lines to mayor sights could be long. However, you can avoid or skip the lines (as you prefer to call it) just by booking your ticket online and showing it to the personal.
I second the "buy early" advice. We booked the Secret Passages Tour (highly recommended) online, and when we turned up on April 29, the line of people queueing up to buy ttickets was very long. And that was only April, nowhere near peak tourist season. Buying online saved us at least 45 minutes of doing nothing but waiting in line, so if you want to maximise your time enjoying what Florence has to offer, and minimise time spent standing around in lines, I'd say "buy now" :)
I would add that if possible go on a weekday and go early. Stuart and I visited almost at the same time except he on a Sunday and I on a Tuesday and the difference in crowds was significant.
"Stuart and I visited almost at the same time except he on a Sunday and I on a Tuesday and the difference in crowds was significant." - That may also have been because it was the last Sunday of the month. Maybe a free entry day, I don't know, but if so, one moe proof that I really know how to pick 'em :)
It's the first Sunday, not the last. ;) I happily enjoyed a free entrance to the Bargello that day. But I don't think Palazzo Vecchio is one of those state museums that are included.