Knowing the best cornichon substitutes is important if you spend a lot of time in the kitchen, but significantly less time at your local market!
These French-style pickled cucumbers may have made a comeback in recent years, but cornichon substitutes are still necessary around the kitchen in case your supply runs dry! Cornichon is 1-2 inches in length and offers a deliciously sharp and sour flavor and a crunchy texture. 
They are traditionally eaten with a cold spread of breads, cheeses, salads, and meats, but can be chopped and incorporated into other recipes, such as tartar sauce.
Probably the closest substitution to cornichons, dill gherkins might also be pickled cucumbers with very similar flavor and texture. They are not exactly the same. Dill gherkins are made from a larger variety of cucumber and purists will attest to the crunchier nature of cornichons! But they are close enough to be indistinguishable to most people!
To achieve a homemade version of cornichons, cut a cucumber in long chunky slices and allow them to soak in a bowl with salt, tarragon, and vinegar. 
You can treat zucchinis in a similar way to cucumber (see above). Both members of the gourd family (Cucurbitaceae), the zucchini may offer a similar base flavor to the cornichon but will be denser and less moist than cucumbers.
If it’s the sour and pickled flavor that you’re after, you don’t need to stick to the cucumber family. There is a range of pickled vegetables to try. Carrot, cabbage, and radish all may pickle very well. Either make your own pickle at home or buy them from a supermarket or deli. 
If you’re simply looking for something tangy, sour, and sweet to go with your cheese and crackers, there are a range of chutneys that will tickle your taste buds and be a great accompaniment to both plain and rich foods.
If it is only the sharp zest that is required in a recipe, you could add just a little white vinegar for flavor. However, bear in mind the different texture and compensate for the extra liquid elsewhere in the recipe.