Some relays try to store messages for as long as possible (aside from cleaning up some really large spammy ones), some others keep a certain number of messages.
There are some relays that have no storage at all, they only relay messages between connected clients and then discard the messages.
There are some relays that have no storage at all, they only relay messages between connected clients and then discard the messages.