Famously, Aristotle had an idea that there existed three good type of governments that easily could pervert into bad governments:
Monarchy could degenerate into tyranny.
Aristocracy could degenerate into oligarchy.
Democracy could degenerate into oclocracy (rule of the mob).
While we may be justifiedly suspicious as to whether monarchy or aristocracy are good type of governments, Aristotle does have a point that various governmental types can carry within them the seeds for their own destruction.
That is also the case with democracies, also the modern forms of them:
The oclocracy is essentially a type of government that says ALL attitudes, laws and rights in a society can be dispensed with/ instituted insofar as the majority of the populace wishes it.
But note that this is utterly at odds with the concept of individual RIGHTS.
Whether we regard rights as inalienable or as prima facie rights in a contractual, egalitarian sense, if we are to follow the oclocratic model, the individual as such has NO rights other than those the prevailing majority might concede to him.
If the majority desire to kill all elderly women because sagging breasts are ugly, then the oclocratic model says they are fully entitled to do so.
Yet, in a rights system, the individual can command a degree of respect from the majority on basis of his non-violation of the basic contract.
In order for a rights-based system to actually function, therefore, the desires of the majority are NOT to be regarded as intrinsically valid, but only insofar as they are consonant with the underlying system of rights.
And, equally importantly, if a minority sees that THEIR rights, or some other individuals’ rights are threatened and undermined, then such a minority must be conceded the right to subdue the majority, with violence if necessary.
Thus, to go against the opinion of the majority can be morally justifiable.
A democracy (in the sense of a good government) can then be defined as a system in which the majority vote is to be respected/implemented, INSOFAR as that vote does not violate basic individual rights.
If it does, then it is invalid.