1. A method of processing data during a training operation to train a data model involving multiple iterations of data records in a dataset stored in a database, the method comprising: allocating memory space in the database for maintaining the data model during the training operation, reading said data records in the dataset directly from the database for each iteration, training the data model inside the database by repeatedly applying the read data records in the training operation to successively update the data model to generate an updated data model in said memory accordingly, checking whether the updated data model has converged according to a predefined convergence condition, and saving the updated data model once the updated data model has converged.