The database lives outside the lambda environment. Unfortunately the serverless stack still doesn't have a a way of solving a problem when it comes to storing the data inside the serverless functions.
Webiny uses MongoDB, for the manage hosted versions, we actually run on AWS DocumentDB.
Hope this answers your question.