Most European states in Swift's time were hereditary monarchies. Of the few exceptions, the oldest and most important was Venice.
The city state was governed by the elected "doge" (duke). The first doge, according to tradition, was Paolo Lucio Anafesto, elected in 697. By the time of the book, Venice had been a republic for a thousand years and had virtually never been troubled by civil turmoil.
However Venice was by no means a democracy. Only a few leading families had any say in the election of the doge.