Database on ELK stack

is elastic has a database?

yes it is called elasticsearch.
data gets store in it in Lucene format.

Elasticsearch is not an ACID compliant database. It is a NoSQL datastore.

Check out What is Elasticsearch? | Elasticsearch Reference [7.11] | Elastic and it's related chapters for more info.