The Internet of Things (IoT) is an emerging paradigm that envisions the interconnection of (physical and virtual) objects through innovative distributed services. With the advancement of hardware technologies, the number of IoT services is rapidly growing due to the increasing number of connected things. Currently, there are about 19 billion connected things, and it is predicted that this number will grow exponentially in the coming years. The scale of IoT systems will hence surpass human expectations as such systems will require the composition of billions of services into complex behaviours. Thus, scalability in terms of the size of IoT systems becomes a significant challenge. Existing service composition mechanisms (i.e., orchestration, choreography and dataflows) were primarily designed for the integration of enterprise services, not for the physical world. For that reason, they do not provide the requisite semantics and hence properties for tackling the scalability challenge that future IoT systems pose. In this thesis, we identify crucial scalability requirements for IoT systems, and propose an algebraic service composition model for the construction of large-scale IoT systems. The resulting model, DX-MAN, has been validated with a software platform and evaluated against the scalability requirements. A comparison with the related work shows that DX-MAN advances the state of the art on IoT service composition and it is, therefore, promising for the construction of future large-scale IoT software systems.