0

At some point a dedicated iot device and app may be created but I'm working with an app on an iPhone for now that doesn't address the requirements but still helpful.

The app can stream it's data via POST. I have a php file set up that captures the data and writes it out to a csv file.

  1. The data is a time series with several columns of data that is sent as a POST at every second. It's about 10 minutes in total time.
  2. Instead of writing to a csv, the data needs to be persisted to a database

What I'm unsure about...

  1. Since this is just testing a proof of concept, it may not be an issue till later but can the high frequency of new connections inserts be expensive? Assuming that each for POST a new connection is needed. For now I have no way of authenticating the device so I'm assuming I can use a local account for all known devices.
  2. Is there a better way of handling the data than running a web server with a php script that grabs the data? I was thinking of Kafka + a connector for a database to persist the data but I have no way of configuring the mobile app to know what it needs to do to send data to the server. Communication is not both ways. Otherwise, my experience with POST requests are the typical web form inputs

Anyone able to give some guidance?

pad11
  • 311
  • 3
  • 9
  • HTTP is heavy for heartbeats. Have you considered a lighter protocol like MQTT? And you have a single PHP app? How will that scale to handle hundreds to thousands of devices? – OneCricketeer Jul 09 '18 at 07:43
  • Wouldn't I need to be able to rewrite the mobile app to handle MQTT? For now using the app which only has csv and POST as options for getting its data. Or can I use the POST from the device to receive as MQTT? I guess I wanted to build something a little more sophisticated but not sure if I'm limited really to just csv for now – pad11 Jul 09 '18 at 10:45
  • 1
    Yes, you'd need a rewrite. Even CSV is too simple for a data format and represents no data types other than string when you could use Protobuf, JSON, or Msgpack. My point is that mobile devices have limited resources and you should use technologies that accommodate for those constraints. I only suggest MQTT because there's a Kafka Connector for it. CoAP could be another option, but don't know much about it myself – OneCricketeer Jul 09 '18 at 12:21
  • Ok thank you very much for the info! I may try to create an iOS app to do MQTT instead. – pad11 Jul 11 '18 at 03:42

0 Answers0