PubNub Chat allows you to store and retrieve messages as they are sent over the network by using the Storage & Playback feature. PubNub Storage uses a time-series based database in which each message is stored with a timestamp to the nearest 10 nanoseconds. You can fetch messages from storage using the History API by passing a start or end timestamp and the space that the messages were published on.

PubNub message retention policy can be configured from your account with the following options: 1 day, 7 days, 1 month, or Forever.