No, that's not too far. The bathroom ceiling fans in my basement suites have 20 feet of vertical duct to go through before coming out the vent caps on my flat roof. But, if I were you, I would go the shortest straightest route to get out your roof.
The bottom line is that the shorter, straighter and smoother your bathroom fan vent ducting is, the easier air will flow through the duct and so the higher the volume flow rate through the duct, and the better the fan will work. The following web site shows the "length equivalents" for common fittings for water flow through various sizes of water pipe.
You can see that any perturbation on the ID of the pipe (such as would be caused by a valve or a tee) or change in direction of the flow (as would be caused by a 45 or 90 degree elbow) offers resistance to flow which is expressed as an equivalent length of pipe. There are similar charts for air flow through various size ducts. The length of your duct and any bends in it, and even the roof vent on the end of the duct are all going to increase the resistance to air flow, and reduce the air flow rate out of the bathroom when the fan is on.
Since many of the most common problems associated with bathrooms arise from poor or non-existant ventilation, ensuring you have good ventilation in a bathroom is a wise investment, and you don't want to cut corners here.
So, if it were me, I would use an insulated duct (or insulated it yourself) and have your bathroom fan duct go straight up from the fan through your roof. Any shingle roofing company would be able to install a fan vent on your roof, and this is the kind of thing that you typically only do once in a blue moon, or whenever you add a bathroom to your house, so it's not like it represents a major expense when you consider it's something that's done seldom and greatly affects the comfort of your house. (In some houses even here in Winnipeg, there are windows instead of ceiling fans (the building code here required one or the other at one time), and the condensation problems some people have on those windows in winter is Gawd-awful. A good bathroom ceiling fan that works well will make your house more comfortable to live in by reducing condensation and mildew problems and eliminating excess humidity from your environment.)
I have also heard of people running the fan duct out a soffit along the side of their house. The problem that may occur there, however, is that an condensation that does form inside the duct will leak out at the duct joints and possibly cause water damage to the ceiling in places inside your house.