从数据库加载价值

I have a database table called quotes.

I would like to load a random quote from the table and after 5 seconds, have it fade out and fade in a new quote derived from the DB.

Database Layout for table 'quotes' ID | Author | Quote

For general case:
In Back-end: Create a route which returns a random 'Quote' record.
In Front-end: Create an ajax call to the route every 5 second.