For primary fermentation, if using 5 gallon carboys, you almost always want to use a blow-off hose. For larger carboys, such as 6 and 6.5 gallon, you can probably get by with using the airlock for most beers. When doing secondary, a blow-off hose shouldn’t be necessary, no matter the fermenter size. Below is a stout 24 hours after pitching the yeast. 2 hours later, the krausen was pushing up through the hose. Had I used an airlock, the ceiling would have been speckled and I would have had a broken airlock. I tend to have more issues with krausen in darker beers such as stouts and porters.
If you haven’t brewed a particular beer before and are not sure how active it will be, always lean towards the side of caution and use the blow-off hose. Once you have determine the beer style didn’t get near the top of the carboy you can choose to use an airlock next time you brew that style, however, always keep an eye on any fermentation the first 48 hours.
When using a blow-off hose, you want to put the exhaust side of the hose into a bucket of sanitizing solution. I use Star San solution since it is readily available on brewing day for sanitizing my other equipment. Attached below is a video of the pickle jar I use and the initial stages of fermentation as the bubbling rate is still picking up.
If you decide to stick with an airlock it is not uncommon for some of the sanitizing solution to leak out the top. This has never presented a problem for me as I have always had enough liquid left at the end of fermentation to still seal off the beer from outside air. If it does get low, be sure to top it off. Below is a video showing an airlock during fermentation. The advantage of using an airlock is ease of popping it on and taking it off as well as space. The blowoff hose and bucket can be awkward and take up valuable space if fermenting in a fridge / freezer.
An alternative?
If you really don’t want to deal with a blow-off hose then you can use Fermcap-S Foam Inhibitor to keep the krausen from becoming an issue. Just add 2 drops per gallon prior to fermentation.