# Embedding design questions

**URL:** <https://discuss.elastic.co/t/embedding-design-questions/22008>\
**Category:** Elasticsearch\
**Created:** [February 6, 2015, 7:46am UTC](https://discuss.elastic.co/t/embedding-design-questions/22008 "2015-02-06T07:46:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![marko1](https://avatars.discourse-cdn.com/v4/letter/m/3d9bf3/32.png) [@marko1](https://discuss.elastic.co/u/marko1)\
**Post date:** [February 6, 2015, 7:46am UTC](https://discuss.elastic.co/t/embedding-design-questions/22008/1 "2015-02-06T07:46:05Z")

</div>

I'm planning to embed a full ES server within a custom application. ES  
customization will be implemented through the ES plugins mechanism. The  
plan is to create a single runnable jar that would include all the ES +  
plugin dependencies. A custom main class would automatically setup  
environment specific configuration and then start up ES bootstrap class.

It seems that the plugin code can be bundled in a single jar with the rest  
of ES + libs, provided that all the es-plugin.properties files can be  
loaded from plugins//.

I'm using the sbt build tool which fetches elasticsearch.jar from Maven  
repository. I noticed that some of the jars that are included with the ES  
distribution package are marked as optional, compile-time dependencies and  
are not included in my package.

Is there any documentation about when a particular optional dependency is  
needed?

Is this type of embedding approach suitable to be used with ES?  
Any caveats to be aware of?

thanks,  
marko

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/4028e9d5-222a-46f1-a403-e2f32102c988%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/4028e9d5-222a-46f1-a403-e2f32102c988%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 6, 2015, 8:49am UTC](https://discuss.elastic.co/t/embedding-design-questions/22008/2 "2015-02-06T08:49:16Z")

</div>

About optional dependencies, I have seen in the past some things around groovy and geo stuff.  
So basically, if you don’t use scripts in your embedded app or any Spatial4J related types, you can probably omit them.

Embedding elasticsearch can work IMHO. But be aware that your application is also running in the same JVM, that you are may be deploying this in a container (Tomcat/JBoss/Whatever) so you are subject to GC generated by those layers as well. If your application is not overloaded, you can probably do this.  
If you are touching the limit, you could at some point transform your embedded Node to a Client Node or replace with a Transport Client and run elasticsearch in its own process.

HTH

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr [https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr) | @scrutmydocs [https://twitter.com/scrutmydocs](https://twitter.com/scrutmydocs)

> Le 6 févr. 2015 à 08:46, marko [marko.asplund@gmail.com](mailto:marko.asplund@gmail.com) a écrit :
> 
> I'm planning to embed a full ES server within a custom application. ES customization will be implemented through the ES plugins mechanism. The plan is to create a single runnable jar that would include all the ES + plugin dependencies. A custom main class would automatically setup environment specific configuration and then start up ES bootstrap class.
> 
> It seems that the plugin code can be bundled in a single jar with the rest of ES + libs, provided that all the es-plugin.properties files can be loaded from plugins//.
> 
> I'm using the sbt build tool which fetches elasticsearch.jar from Maven repository. I noticed that some of the jars that are included with the ES distribution package are marked as optional, compile-time dependencies and are not included in my package.
> 
> Is there any documentation about when a particular optional dependency is needed?
> 
> Is this type of embedding approach suitable to be used with ES?  
> Any caveats to be aware of?
> 
> thanks,  
> marko
> 
> --  
> 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) [mailto:elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/4028e9d5-222a-46f1-a403-e2f32102c988%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/4028e9d5-222a-46f1-a403-e2f32102c988%40googlegroups.com) [https://groups.google.com/d/msgid/elasticsearch/4028e9d5-222a-46f1-a403-e2f32102c988%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/4028e9d5-222a-46f1-a403-e2f32102c988%40googlegroups.com?utm_medium=email&utm_source=footer).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout) [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/2AB63EB3-DDAA-4AF2-8264-7989B9D09597%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/2AB63EB3-DDAA-4AF2-8264-7989B9D09597%40pilato.fr).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:34am UTC](https://discuss.elastic.co/t/embedding-design-questions/22008/3 "2017-07-06T00:34:33Z")

</div>


