Problem with Openfire data is taking time to update in MySQL

i sent message to user its delivered to user but in Archive its take 5 to 8 sec to update the Archive

Openfire makes no guarantee to write data to the database in real time. It will cache some database updates for efficiency. Openfire is not designed to share its database with other applications (with the exception of very specific parts). If there’s no reason to assume contention, then it stands to reason that this is just how Openfire works. If you need data to exist in a database within a certain time, then you’re likely trying to add functionality in a way that is not recommended with Openfire.