If you are asking for yourself then there is no substitute for going to your doctor to get a professional opinion.
That said you'll hear all sorts on the net. Surgeons will show you data that it is the only effective medical intervention for weight loss at a population level. They may decline to be so transparent about some of the more unpleasant details in the early stages.
I knew a woman who had a gastric bypass (think it was a roux en y) who said she basically just vomited if she ate a whole milky bar. Another who had a sleeve gastrectomy complained that they now hated food and, while thinner, were depressed and faced malabsorption issues. A man who had been fitted with a gastric band was currently in the process of consciously stretching it out, thereby undoing the potential benefit of major surgery.
Make sure you have exhausted, really exhausted, all other avenues of weight loss before contemplating such drastic measures.