'How to design a Spring REST server with a parallel business logic function

I'm currently building server software in Java. I already have a running backend, which is build with Spring Boot. It has an REST interface to read and write data to a MySQL database (with Spring JPA).

Now I have the following problem: In addition to the REST functions, the backend server should also have a function, which runs periodically (multiple times per second). It should read pricing data from the web, and automatically perform some operations with data from the same MySQL database.

How would the correct approach to implement this look like?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source