Consider sorting the messages on db in get messages query and not on the server, see if that would result in faster response times.
Consider removing id field and putting the ttl as sort key instead.
Consider a conversation table with a field of messages that is a list, queries will be super quick because of a single document with a unique number key, but how do we apply TTL on the list elements? How about a daily Cron job that filters the list inside each conversation?
Consider sorting the messages on db in get messages query and not on the server, see if that would result in faster response times.
Consider removing id field and putting the ttl as sort key instead.
Consider a conversation table with a field of messages that is a list, queries will be super quick because of a single document with a unique number key, but how do we apply TTL on the list elements? How about a daily Cron job that filters the list inside each conversation?