The International Residential Code specifies only one requirement when it comes to post strength: the top of the post must be able to withstand a 200-pound force in any direction. Although that doesn't sound like much, it actually translates to a sheer force of almost 2,000 pounds at the base of a 4-foot post -- more than enough to pull lag screws out of a rim joist. Carriage bolts can withstand this force, but not much more, and prudence requires including a safety factor to account for weathering, material degradation and repeated use of the handrail.
Notching Not Recommended
A common method for attaching posts to a deck is to cut a notch in the base, fit the notch over the rim joist and drive fasteners through the outer face of the notch. This is a bad idea, but not because the notch has a greater likelihood of breaking. It doesn't. The problem is that changes in moisture and temperature cause cracks to develop at the corner of the notch, and these spread along the grain toward the top of the post, greatly weakening it. The crack can reduce the holding strength of a 4-by-4-inch post to that of a piece of 3/4-inch lumber.
Safest Way to Attach Posts
Researchers at Virginia Tech found only one way to secure posts that satisfied their stringent testing requirements. The method is to bolt a special metal tie to the lateral joist that has an eye in the end angled at 90 degrees to the joist. The carriage bolt holding an un-notched post fits through the eye and gets secured with a nut. The tie then sustains the brunt of the lateral force -- not the wood or the joist fasteners. The top bolt of every post should be secured with one of these ties.
Attaching Rails and Balusters
To make the railings as strong as possible, attach them to the posts with metal fasteners rather than simply driving screws at angles through their edges. Metal corner brackets attached to the undersides of the rails and screwed into the posts are innocuous, and they won't split the wood. If your design includes balusters, eliminating the bottom rail and screwing the bottoms of the balusters to the rim joist makes them secure. If you prefer a bottom rail, screw the balusters to both rails and then attach each section of finished railing to the posts as a unit.