If you want to avoid choosing between using VMs or a container, you can opt for a serverless microservice deployment instead. Serverless deployment is a cloud-based deployment model in which the cloud provider manages all resources that are utilized by microservices dynamically. They charge based on the actual usage of resources by microservices.
Serverless cloud computing is provided by cloud vendors such as Amazon, Google, or Microsoft. Amazon provides AWS Lambda as a serverless deployment technology, which supports Java, Python, and Node.js languages. You can easily deploy microservices to the serverless platform by packaging the microservices as ZIP files and uploading them to AWS Lambda. The serverless platform automatically runs instances of your microservices to handle incoming requests. Serverless cloud computing also uses resources such as the server, memory, and CPU, but you don't have to worry about the infrastructure.
Google provides the Google Cloud Function as a Function as a Service (FaaS), and Microsoft provides the Azure Function. Amazon's AWS Lambda function is a stateless service