# Best practice for the creation of an index

**URL:** <https://discuss.elastic.co/t/best-practice-for-the-creation-of-an-index/324246>\
**Category:** Elasticsearch\
**Created:** [January 30, 2023, 3:45pm UTC](https://discuss.elastic.co/t/best-practice-for-the-creation-of-an-index/324246 "2023-01-30T15:45:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![QuentinV](https://avatars.discourse-cdn.com/v4/letter/q/2bfe46/32.png) [@QuentinV](https://discuss.elastic.co/u/QuentinV)\
**Post date:** [January 30, 2023, 3:45pm UTC](https://discuss.elastic.co/t/best-practice-for-the-creation-of-an-index/324246/1 "2023-01-30T15:45:06Z")

</div>

Hello.

I'm working on a project with Elastic for my company.  
I have to export some logs from the test software of our solution to an elastic database.  
Every night, the test software will create many logs with Java, using the JavaAPI, but I don't know what is the best practice to do. Should it be an unique entry with many tests, many time updates during the night or should every test be an independent entry in the index?

The project is an inside project of the company and will be used by a single person at a time. We don't need extraordinary performances and we will exploit the data with an Angular app on front later.

We will create an unique index for all the test and all the result. Is it the good practice or should we create many index?

thanks and have a good day

* * *

_ **indepandant entry:** _  
In this case, everytime a test is done, we push it in the data base with the same idOfTheTestSerie1 for all test in this night.

```auto
{
    "idOfTheTestSerie1": " ********",
    "idOfTheTest1": " ********",
    "someInformationAboutTheTest": " ********",
    "commentaires": 
    [
        {
            "part1Test1": " *****",
            "informations": " *******"
        },
        {
            "part2Test1": " *****",
            "informations": " *******"
        }
    ]
}
{
    "idOfTheTestSerie1": " ********",
    "idOfTheTest2": " ********",
    "someInformationAboutTheTest": " ********",
    "commentaires": 
    [
        {
            "part1Test2": " *****",
            "informations": " *******"
        },
        {
            "part2Test2": " *****",
            "informations": " *******"
        }
    ]
}

```

_ **or unique entry** _  
In this case, we push an unique data in the database and we update it everytime a test is finished.

```auto
{
    "idOfTheTestSerie1": " ********",
     "test": 
     [
        {
           "idOfTheTest1": " ********",
           "someInformationAboutTheTest": " ********",
           "commentaires": 
           [
                {
                    {
                        "part1Test1": " *****",
                        "informations": " *******"
                    },
                    {
                        "part2Test1": " *****",
                        "informations": " *******"
                    }
                }
            ]
        },
        {
            "idOfTheTest2": " ********",
            "someInformationAboutTheTest": " ********",
            "commentaires": 
            [
                 {
                     {
                         "part1Test2": " *****",
                         "informations": " *******"
                     },
                     {
                         "part2Test2": " *****",
                         "informations": " *******"
                     }
                 }
             ]
        }
    ]
}

```

---

<div class="post-metadata">

**Author:** ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)\
**Post date:** [January 30, 2023, 3:55pm UTC](https://discuss.elastic.co/t/best-practice-for-the-creation-of-an-index/324246/2 "2023-01-30T15:55:20Z")

</div>

All the test, all the log will created hundreds of index and hundreds of shard.

one node in cluster has limit of 1000 shard. beyond that it will work but it can create lot of problem.

rule of thumb is you create a shard worth of 20-30gig if it is possible.

---

<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:** [February 27, 2023, 3:56pm UTC](https://discuss.elastic.co/t/best-practice-for-the-creation-of-an-index/324246/3 "2023-02-27T15:56:21Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
