# Difference between create in bulk API and simple create API in loop with elasticsearch

**URL:** <https://discuss.elastic.co/t/difference-between-create-in-bulk-api-and-simple-create-api-in-loop-with-elasticsearch/41016>\
**Category:** Elasticsearch\
**Created:** [February 5, 2016, 1:55am UTC](https://discuss.elastic.co/t/difference-between-create-in-bulk-api-and-simple-create-api-in-loop-with-elasticsearch/41016 "2016-02-05T01:55:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rahul\_Garg](https://avatars.discourse-cdn.com/v4/letter/r/bb73d2/32.png) [@Rahul\_Garg](https://discuss.elastic.co/u/Rahul_Garg)\
**Post date:** [February 5, 2016, 1:55am UTC](https://discuss.elastic.co/t/difference-between-create-in-bulk-api-and-simple-create-api-in-loop-with-elasticsearch/41016/1 "2016-02-05T01:55:00Z")

</div>

I want to know what is the difference between if i create 20 records with bulk API and if i create 20 records with create API with elasticsearch.

Few questions:

1. Does the index will updated only once in case of bulk API?
2. Does the performance will be more in case of Bulk API?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [February 5, 2016, 3:39am UTC](https://discuss.elastic.co/t/difference-between-create-in-bulk-api-and-simple-create-api-in-loop-with-elasticsearch/41016/2 "2016-02-05T03:39:36Z")

</div>

You only need one network round trip, not 20, that's the big thing.

---

<div class="post-metadata">

**Author:** ![mosiddi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mosiddi/32/577_2.png) [@mosiddi](https://discuss.elastic.co/u/mosiddi)\
**Post date:** [February 5, 2016, 5:20am UTC](https://discuss.elastic.co/t/difference-between-create-in-bulk-api-and-simple-create-api-in-loop-with-elasticsearch/41016/3 "2016-02-05T05:20:21Z")

</div>

> [@Rahul\_Garg](#):
>
> Does the index will updated only once in case of bulk API?

Internally w.r.t. segment creation, the # of requests coming directly or in bulk will not create a difference. Lucene will treat even bulk indexed requests individually.

> Does the performance will be more in case of Bulk API?  
> yes, since you avoid the network round trips

---

<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, 11:18pm UTC](https://discuss.elastic.co/t/difference-between-create-in-bulk-api-and-simple-create-api-in-loop-with-elasticsearch/41016/4 "2017-07-05T23:18:44Z")

</div>


