Electricity is a basic requirement these days, everything in houses and offices is run on it. In Pakistan, with the power issues a lot of people set up a UPS system but if your power consumption needs are not met by that and there are more things to run while the power is out then a generator is what you need. UPSs cannot handle things that require more power like ACs and if the power outage is of a longer duration the UPS battery will die. A generator, on the other hand, will run till it is out of the required fuel. The power rankings for generators are in kVAs, the higher the number prefix before'kVA' the more power the generator is putting out and the larger ones consume more fuel. Generators are also built with a self-start feature so you don't have to go outside and flip a switch when the electricity is gone which is convenient as it just kicks on and starts supplying power to the premises.
A generator can be powerful enough to run everything in a building or small and compact enough to supply the needs of one small shop. There are some that run on diesel some on petrol and others that can use a gas connection to generate electricity, which you get could be a question of feasibility or which form of fuel is more easily accessible to you. Petrol generators over time are less fuel-efficient so between that and diesel people prefer the diesel ones. Gas is not always easy to get and a lot of places that are far from the electric grid usually don't have a gas line either. So if you had a cabin far out from developed areas diesel or petrol would be more ideal. The advantage with gas generators is that they make less noise and create less pollution but at the same time the downside is that they can be temperamental and more expensive to begin with. The diesel ones are more reliable but a lot noisier and they have a lot larger a carbon footprint! With some modern upgrades there is the possibility of a soundproof diesel generator that reduces the noise to more of a hum than a loud drone, which is a huge difference. Over a longer period though a diesel generator will mostly outlast a gas-based one as the engine that uses gas is not as robust and has more parts that can go bad. The question is what one's power requirements are of the generator and where it is going to be used, based on that you can decide what works for you!