I read this book many years ago. It is set on a double planet with a shared atmosphere. The people on the planet have a caste system, they are either military or thinkers. There are giant trees on the planet, which are used for almost everything, building materials as well as an energy source from the crystals the trees form.
There are also poisonous bubbles that float around. The inhabitants were able to destroy them with ranged weapons, but the bubbles became more dangerous which forced the mass migration of the inhabitants to the adjoining planet via balloons made from and powered by the giant trees.
There is also a sequel where the main character from the first book travels through space to another planet in the system using a more advanced rocket based off the trees.