0

I am designing a MVP for a simple gamification system for a trampoline park(s).

External company is providing bracelets for customers, then collecting this data in their own web app, where they extract things like "time in air", "number of jumps" etc. in real time from accelerometer readings (x,y,z)

I need to receive this transformed data somehow and display it on a scoreboard (among other things). My problem is with how to integrate their data with my system.

First I considered the simplest possible scenario - one trampoline park and 10 bracelets.

The simplest solution would be to connect my web app with their web app via websocket directly, receive transformed data from bracelets in real time and update the score on my website.

Things start to fall apart when I consider scaling the app to multiple trampoline parks and hundreds/thousands of bracelets

I started researching some integration patterns but this is a very broad area and I am new to things like this. I stumbled upon technology called Apache Kafka, it deals with streaming data (don't know if data from bracelets can be called streaming data, or is it more reserved for things like audio/video streaming for example on twitch or netflix?)

So the basic architecture I came up with is like this (I don't know if it makes any sense, if it's a good use case for Apache Kafka and if it isn't an overkill in my scenario):

  1. External company collects the data from thousands of bracelets and transforms the data (from "x,y,z" readings to things like "time in air" or "jump occured" etc.)
  2. Transformed data is being published to Apache Kafka on AWS (each trampoline park has its own topic?)
  3. I run multiple instances of my web app, one per trampoline park, all of them subscribe for 1 topic each, all of them are connected to the same database (PostgreSQL on AWS), so users can go between different trampoline parks and still have all their data persistent
  4. I consume data from Apacha Kafka and use it for my internal reasons (eg. calculating current bracelet user score)

So my questions would be:

  1. Does that architecture make any sense?
  2. Is this a good use case for Apacha Kafka or is this an overkill? Or maybe there are some better technologies to use? Maybe RabbitMQ is enough?
  3. Not sure if I should have one central web app to gather data about all trampoline parks or if I should spread it among many smaller apps, one for each trampoline park, but I will still need some central server to coordinate...
2
  • Apache Kafka on AWS can be simplified by simply using Kinesis, it'll support your functionality just fine (I'm guessing you don't need message replays etc). Apache Flink can be used for accumulating data in soft-realtime directly from Kafka/Kinesis/<insert-any-message-queue/streaming-platform>. However, the question feels too broad and subjective, I suggest doing more research on your own and then asking more concise questions. Commented Mar 3, 2020 at 12:59
  • Yes, "event streaming" applies as a pattern
    – Martin K
    Commented Mar 5, 2020 at 9:27

1 Answer 1

-1

We have no idea how the data from vendor is being made available, whether you can get them to broadcast their data directly to some broker. In any case, my two cents would be:

  • RabbitMQ should be fine, even if they offer their data every 100ms doesn't mean it makes sense to read every update if they are aggregating the accelerometer readings anyway.
  • A relational db like Postgres doesn't really make sense for this simple time series data, I would use something like MongoDB

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.