# Impact of JSON modeling on search performance

**URL:** <https://discuss.elastic.co/t/impact-of-json-modeling-on-search-performance/48023>\
**Category:** Elasticsearch\
**Created:** [April 21, 2016, 10:37am UTC](https://discuss.elastic.co/t/impact-of-json-modeling-on-search-performance/48023 "2016-04-21T10:37:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![drjz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/drjz/32/972_2.png) [@drjz](https://discuss.elastic.co/u/drjz)\
**Post date:** [April 21, 2016, 10:37am UTC](https://discuss.elastic.co/t/impact-of-json-modeling-on-search-performance/48023/1 "2016-04-21T10:37:09Z")

</div>

Assume I have the following JSON document with an array of objects.

> {  
> "phoneNumbers": [  
> {  
> "type": "home",  
> "number": "212 555-1234"  
> },  
> {  
> "type": "office",  
> "number": "646 555-4567"  
> },  
> {  
> "type": "mobile",  
> "number": "123 456-7890"  
> }  
> ]  
> }

What is the impact if I add an extra object "number" between the array and its objects and change this document to:

> {  
> "phoneNumbers": {  
> "number": [  
> {  
> "type": "home",  
> "value": "212 555-1234"  
> },  
> {  
> "type": "office",  
> "value": "646 555-4567"  
> },  
> {  
> "type": "mobile",  
> "value": "123 456-7890"  
> }  
> ]  
> }  
> }

How much does the addition of extra levels of JSON objects have a cost in terms of search performance? The less you store, the better. But I wonder what the impact is if we add extra levels of depth.

---

<div class="post-metadata">

**Author:** ![danielmitterdorfer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/danielmitterdorfer/32/110510_2.png) [@danielmitterdorfer](https://discuss.elastic.co/u/danielmitterdorfer)\
**Post date:** [April 21, 2016, 11:27am UTC](https://discuss.elastic.co/t/impact-of-json-modeling-on-search-performance/48023/2 "2016-04-21T11:27:44Z")

</div>

Hi,

this question is way too broad to answer and depends on too many factors. Some questions for you to ponder: What's your Elasticsearch version? How do your queries look like? How do your access patterns look like (for starters: do you have bulk indexing run in parallel)? What query throughput are you targeting (latency is _not_ independent of throughput, google for Little's law)? What hardware do you use? What OS? How is your cluster configured? What's your network topology? And tons of other questions too.

If you **really** bother you could write a benchmark. We've just released [Rally](https://github.com/elastic/rally) to help you with that (see also the [Rally release blog post](https://www.elastic.co/blog/announcing-rally-benchmarking-for-elasticsearch). But I guess this change has so little impact, it will completely vanish in the (unavoidable) measurement noise. I'd also urge you to be very careful with your benchmarking methodology (silent machine, silent network, multiple trial runs, check for accidental bottlenecks, etc.).

Daniel

---

<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 5, 2017, 10:57pm UTC](https://discuss.elastic.co/t/impact-of-json-modeling-on-search-performance/48023/3 "2017-07-05T22:57:20Z")

</div>


