# Using ElasticSearch how db for a e-commerce

**URL:** <https://discuss.elastic.co/t/using-elasticsearch-how-db-for-a-e-commerce/13849>\
**Category:** Elasticsearch\
**Created:** [October 4, 2013, 7:54pm UTC](https://discuss.elastic.co/t/using-elasticsearch-how-db-for-a-e-commerce/13849 "2013-10-04T19:54:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tiago\_Rodrigues](https://avatars.discourse-cdn.com/v4/letter/t/c4cdca/32.png) [@Tiago\_Rodrigues](https://discuss.elastic.co/u/Tiago_Rodrigues)\
**Post date:** [October 4, 2013, 7:54pm UTC](https://discuss.elastic.co/t/using-elasticsearch-how-db-for-a-e-commerce/13849/1 "2013-10-04T19:54:28Z")

</div>

Hi guys,

I want to make an e-commerce using ElasticSearch as a database in PHP, I  
have some experience with dbs in mysql, but I want to use ElasticSearch as  
a single database for many reasons.

My question is, can I use the mapping as tables in mysql?

Anyone can show me an example of a mapping shopping cart?

Thanks

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [October 6, 2013, 5:01pm UTC](https://discuss.elastic.co/t/using-elasticsearch-how-db-for-a-e-commerce/13849/2 "2013-10-06T17:01:45Z")

</div>

Hey,

As I am not one hundred percent sure what you mean, I'll try to explain a  
bit and will hopefully not be to much offtopic.

First, you can store documents inside of elasticsearch. This means, you do  
not have to flatten out your data like in a SQL database. Just be aware of  
that, when designing your data model.

Now back to your question: You can define your own mapping, which maps  
fields to types, similar to a SQL table definition - but the mapping is not  
like the table content, and again, the mapping describes a document, not a  
flat data structure. You also configure elasticsearch to ignore fields,  
which have not been defined in your mapping, or even to not index documents  
which do not adhere to the mapping you expect. See more at

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

Hope this helps, otherwise feel free to ask more.

--Alex

On Fri, Oct 4, 2013 at 9:54 PM, Tiago Rodrigues [tiago\_tk21@hotmail.com](mailto:tiago_tk21@hotmail.com)wrote:

> Hi guys,
> 
> I want to make an e-commerce using Elasticsearch as a database in PHP, I  
> have some experience with dbs in mysql, but I want to use Elasticsearch as  
> a single database for many reasons.
> 
> My question is, can I use the mapping as tables in mysql?
> 
> Anyone can show me an example of a mapping shopping cart?
> 
> Thanks
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Tiago\_Rodrigues](https://avatars.discourse-cdn.com/v4/letter/t/c4cdca/32.png) [@Tiago\_Rodrigues](https://discuss.elastic.co/u/Tiago_Rodrigues)\
**Post date:** [October 7, 2013, 12:11pm UTC](https://discuss.elastic.co/t/using-elasticsearch-how-db-for-a-e-commerce/13849/3 "2013-10-07T12:11:29Z")

</div>

Em domingo, 6 de outubro de 2013 14h01min45s UTC-3, Alexander Reelsen  
escreveu:

> Hey,
> 
> As I am not one hundred percent sure what you mean, I'll try to explain a  
> bit and will hopefully not be to much offtopic.
> 
> First, you can store documents inside of elasticsearch. This means, you do  
> not have to flatten out your data like in a SQL database. Just be aware of  
> that, when designing your data model.
> 
> Now back to your question: You can define your own mapping, which maps  
> fields to types, similar to a SQL table definition - but the mapping is not  
> like the table content, and again, the mapping describes a document, not a  
> flat data structure. You also configure elasticsearch to ignore fields,  
> which have not been defined in your mapping, or even to not index documents  
> which do not adhere to the mapping you expect. See more at  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping.html)
> 
> Hope this helps, otherwise feel free to ask more.
> 
> --Alex

Not is exactly who i want, but tanks man, this help a lot =D  
(Ps: sory my poor English.)

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 2:13am UTC](https://discuss.elastic.co/t/using-elasticsearch-how-db-for-a-e-commerce/13849/4 "2017-07-06T02:13:26Z")

</div>


