The Shimano road derailleurs (like 105) have a published limit on the largest sprocket- 28 teeth. In reality, you can probably go to 30 teeth without problems. 34 would be a stretch- the guide pulley will hit the sprocket teeth, and it may not even shift to a cog that big. I'd get a mountain derailleur for 32-34 tooth cogs. And I wouldn't necessarily spend the cash to go to the Deore level or above unless I were planning a 9-speed upgrade in its future. Alivio or Acera would be fine. 40 would be impossible even for mountain derailleurs.