Lets say I have multiple devices. Each device has different type of sensors. Now I want to send the data from each device for each sensor to kafka. But I am confused about the kafka topics. For processing this real time data
Is it good to have kafka topic per device and all the sensors from that device will send the data to particular kafka topic, or I should create one topic and have all the devices send the data to that one topic.
If I go with first case where we will create topic per device then,
Device1 (sensor A, B, C) -> topic1
Device2 (sensor A, B, C) -> topic2
- how many topics I can create?
- Will this model scale?
Case 2: where, sending data to one topic
Device1 (sensor A, B, C), Device2 (sensor A, B, C)....DeviceN.... -> topic
Isn't this going to be bottleneck for data. Since it will behave as queue data from some sensor will be way behind in queue and will not be processed in real time.
Will this model scale?
EDIT
Lets say each device is associated with user (many to one). So I want to process data according to devices. So the way I want to process data is, each device and its sensor data will go to the user after some processing.
Say I do following
Device1
-> Sensor A - Topic1 Partition 1
-> Sensor B - Topic1 Partition 2
Device2
-> Sensor A - Topic2 Partition 1
-> Sensor B - Topic2 Partition 2
I want some pub/sub type of behavior. Since devices can be added or removed also sensors can be added or removed. Is there a way to create these topics and partition on the fly.
If not kafka, what pub/sub will be suitable for this kind of behavior.