It depends upon the required load you want to run....
If your running load is Less than 1000 Watts, then UPS is far better and cheaper than generator.
Disadvantages of using generator
1. Sound Pollution, you will be frequently cursed by your neighbors.
2. Running cost is more than UPS,
3. You have to Wake up every time whenever Wapda gone and restore to switch on, switch of generator.
For What exact load you need back up????