A computer-implemented method comprising: executing, by a database instance of a database service, at least a portion of a query on data stored in the database service using a temporary data structure to generate a first batch of machine learning requests, wherein the query identifies a machine learning service, wherein executing at least the portion of the query comprises determining data to be provided to the machine learning service, and wherein each machine learning request includes determined data to be provided to the machine learning service; sending, by the database instance, the first batch of requests to an asynchronous request handler of the database service, wherein a size of the first batch of machine learning requests is equal to an input buffer size of the asynchronous request handler; generating, by the asynchronous request handler, a second batch of machine learning requests based on the first batch of machine learning requests and based on the machine learning service, wherein a size of the second batch of machine learning requests is associated with the machine learning service; receiving, by the asynchronous request handler, a plurality of machine learning responses, the machine learning responses generated by the machine learning service using a machine learning model in response to receiving the second batch of machine learning requests; and obtaining, by the database instance, the plurality of machine learning responses from an output buffer of the asynchronous request handler, wherein the query is a structured query language, SQL, query, wherein the SQL query identifies the machine learning model using an application programming interface, API, call to the machine learning service, and wherein the machine learning service publishes the API to perform inference using the machine learning model in response to requests received from a plurality of users. executing, by a database instance of a database service, at least a portion of a query on data stored in the database service using a temporary data structure to generate a first batch of machine learning requests, wherein the query identifies a machine learning service, wherein executing at least the portion of the query comprises determining data to be provided to the machine learning service, and wherein each machine learning request includes determined data to be provided to the machine learning service; sending, by the database instance, the first batch of requests to an asynchronous request handler of the database service, wherein a size of the first batch of machine learning requests is equal to an input buffer size of the asynchronous request handler; generating, by the asynchronous request handler, a second batch of machine learning requests based on the first batch of machine learning requests and based on the machine learning service, wherein a size of the second batch of machine learning requests is associated with the machine learning service; receiving, by the asynchronous request handler, a plurality of machine learning responses, the machine learning responses generated by the machine learning service using a machine learning model in response to receiving the second batch of machine learning requests; and obtaining, by the database instance, the plurality of machine learning responses from an output buffer of the asynchronous request handler, wherein the query is a structured query language, SQL, query, wherein the SQL query identifies the machine learning model using an application programming interface, API, call to the machine learning service, and wherein the machine learning service publishes the API to perform inference using the machine learning model in response to requests received from a plurality of users.