An efficient real-time architecture for collecting IoT data