User Tools

Site Tools



Q. I'm considering Tarantool for storing chat messages in the JSON format, like this:

{'message_time': {timestamp_here}, 'user': '{user_name}', 'message': '{message_here}'}

Each message has an id and belongs to a certain chat room. I want to get messages by timestamp range from a specified chat. What is the best way to store that information? (2017)

A. You should probably use this layout: [msg_id, chatroom, msg_time, user, message]. Create a TREE index on [chatroom + msg_time], and you'll be able to query from [chatroom + msg_begin_time] with the needed limit.


Enter your comment. Wiki syntax is allowed:
json/storing.txt · Last modified: 2018/05/25 22:55 by eabates

Real Time Web Analytics