What are the key components of a typical IoT architecture, and how do they work together?

When setting up an IoT architecture, what are the main components involved, like devices, gateways, and cloud services? How do they all interact to enable smooth data collection, processing, and analysis? I’m curious to hear how others structure their IoT systems and what tools or platforms work best for handling these interactions efficiently.