Shared Venting gas boiler and water heater

i did a house the other day and this came up, i drew a blank for a moment . i call out the obvious defect of back drafting on the hot water heater. now here is my question.

on a same fuel flue vent: for example.
a system with a separate hot water heater and boiler is sharing the same vent system, the hot water heater is the last on the flue then the boiler the chimney connection … so it goes hot water heater - boiler then the chimney connection. is this aloud , i had always thought that largest btu unit has to be the furthest away on the connection hook up . any thoughts on this…

The water heater’s vent connector enters the chimney above the furnace because the water heater has a smaller input.