Unless you're associating votes with registered accounts, there is no way you can avoid stuffing. The other problems however can be solved independently of whether you follow a file-based or database approach and are merely a matter of proper programming practice.