I have a specific use case where there are multiple lists which contains list items each having a line number. A user may want to rearrange the list and these changes are published through kafka. We can assume the list being something as follows.

  "id": 1001,
  "items": [
      "id": 1,
      "data": "A",
      "lineNumber": 1
      "id": 2,
      "data": "B",
      "lineNumber": 2

So the list would be as [A, B] The event could be something like;

  "id": 1,
  "newLineId": 2

In which the list would then be [B, A]

What would be the best approach to handle reordering of these items? The solution should be scalable as it needs to handle large amounts of data.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.