For safety, most building codes require that railings be at least 36 inches high for decks built more than 30 inches off the ground, with no gaps between balusters or beneath the handrail through which a 4-inch sphere could pass.
Some local codes also bar railings with horizontal members that kids could climb like a ladder. Thankfully, you can build railings out of a variety of materials to suit any style or special circumstance.
Popular options other than wood include taut horizontal or vertical steel cable, metal sheeting or mesh, tubular piping, resin posts and balusters, and even tempered glass panels.