Elasticsearch is a real time search engine based on Lucene, naturally distributed, scalable and Rest server. It basically uses Lucene to do data indexing and makes it scalable through index Clusterization and replication.
Elasticsearch should only be used for searching because it does not have strong referential integrity and at some point the indexes can be corrupted, main when you start to scale the nodes.
Ideally you use the following structure: Front End JS/ Back End JS/ Data Access(Some relational database or NOSQL and index what is relevant to Elasticsearch.
Using Elasticsearch is simple at first glance, but maintaining cluster stability becomes increasingly difficult as the data flow increases and you need more scale.
It is not normal to use ES as "back-end" until because it is a document indexer and not a database.
– Rafael Rotiroti