Elastic search to be deployed as embedded or client/server mode - rest

Which is the preferred mode of deployment for Elasticsearch, embedded mode (embedded in to the product/application) or client/server mode?
Apache Solr and most of the SQL, NOSQL databases are usually deployed in client/server mode. Where server runs as standalone, the client might be a driver library which will be used in the application.
In case of Elasticsearch, client and server binaries are the same. It would be difficult to package two separate Elasticsearch binaries, one for client to use in the application and another for the standalone server. I am planning to go with Rest API because I cannot package two set of Elasticsearch binaries in my product.
What is the general practice for Elasticsearch deployment? Keep Elasticsearch as standalone and use Rest API or embedded Elasticsearch within the application?

For production usage it is better to decouple your application from elasticsearch srever.
Lets say you want to upgrade to elastic 2.X that mean that you will need to re-compile your application - wouldnt it be overhead?
If you to run unit/data integration test you can use elasticsearch as embedded service to your testing needs

Related

Does com.sun.net.httpserver.HttpServer have scalability issues (for production environments)?

I want to use an embedded http server in my enterprise apps (and move away from standalone containers) and was expecting Tomcat to provide an implementation. I was assuming Sun, Jetty and Jersey's implementations cannot support enterprise load.
But looking at Tomcat, I see no way to run REST apps that use JAX-RS, only servlets. So my questions are:
Will use of com.sun.net.httpserver.HttpServer work in a production environment, or do I need another library?
Am I understanding correctly the boundary between JAX-RS embedded servers and servlet containers (maybe that will explain why Tomcat doesn't provide such a server)
Other notes:
I do not want to use Spring unless that's the only choice

Host RESTHeart on IBM WebSphere

I want to host/run RESTHeart on an IBM WebSphere Application Server (traditional V8.5 or Liberty). For default RESTHeart is made to run on Undertow/JBoss(?).
Is there any possibility to do so? I couldn't find anything about that.
You can't. RESTHeart is a plain Java application, it is NOT meant to be ran inside any application server. It's not true it's made to run inside Undertow/JBoss, instead RESTHeart embeds Undertow, to serve HTTP requests very efficiently.
RESTHeart has been developed with a micro-services architecture in mind, because we wanted something simple, without the need to run and manage a fully fledged application server in our production environments.

Micro services with JBOSS

I am new to Jboss, want to know if micro services architecture is a right choice on JBOSS. I cannot change the application server as it is decided by client architect and I have no choice.
Want to know whether we can develop micro services with underlying JBOSS application server.
I understand Spring boot comes with embedded tomcat container, which makes it flexible to stop and start, deploy individual service with no impact to other services.
However will that architecture works with JBoss too.
Please suggest.
Thanks,
I actually developed a feasibility study to investigate the solution you mentioned. My conclusion is that it is totally viable to use Micro Service principles in a JBoss Platform.
I used the combination of JBoss \ Spring Boot \ Netflix to create successful Micro Service stack, I personally do that to find a solution to the transaction problem (multiple micro services collaborating) and the fan out problem which caused because excessive Network communication and Serialization costs.
I also wrote a blog about the subject, you might find more details there if you like to, here is the link.
Micro Services – Fan Out, Transaction Problems and Solutions with Spring Boot/JBoss and Netflix Eureka
By the definition what micro services are, then conceptually yes. A micro service is a service that is an independent unit, it could deployed, updated, and undeployed independently without affecting any unrelated part of your application. So that would mean having multiple instances of JBoss for MS and your application calling them through some sort of gateway or any other mechanism depending on your use case. If you plan to deploy all your MS in the same JBoss instance then it defeats the very purpose of a MS. Given that, JBoss wouldn't be a right choice for MS deployment because it will only make your MS deployment infrastructure quite heavy.
Depending on what your client's requirements are, your could possibly keep your webapp in JBoss and deploy your MS containers separately.
It depends on what you want to get out of microservices.
Some of the developers at my organisation looked at Spring Boot but concluded that it's best off being run as a standalone container rather than in JBoss, otherwise you've effectively got two container frameworks competing (SB and JBoss) and a range of associated issues.
Deploying microservices in JBoss won't give you the same flexibility as a true container system like Docker. With Docker you create standalone packages for your microservices that contain all the code, system tools, runtime environment, etc. It can be as small or large as it needs to be. JBoss on the other hand is a large container running a single JVM designed to hold multiple applications. The level of isolation is not the same, and it's not efficient to have JBoss as a container for a single microservice so you have to appropriately size and then deploy to the instance to make use of the resources it has available.
If you're looking at microservices as a way to gain greater control over service lifecycle management (deployment, versioning, deprecating, etc.) as opposed to an automated, web-scale component deployment model a la Netflix or LinkedIn, you could do this adequately with JBoss.
I'm actually looking to do something along these lines here. It won't be true microservices but by packaging and deploying individual, properly versioned APIs rather than monolithic applications and following most of the other principles of microservice development (componentisation, business function focus, stateless etc.) we will be hopefully better able to manage and benefit from our APIs.
Our APIs will all be behind an API gateway and load balancer so we can choose how we distribute the microserves distributed across the JBoss instances and balance resource usage as required. Note that our organisation is relatively small and has relatively low and predictable traffic so this approach should work fine. Your needs however may be different.

start solrserver deployed inside tomcat from within eclipse

I am working in windows 7 machine.I want to implement search using apache solr with hbase ta
bles as datasource. I have configured apache solr 4.3.1 in tomcat 7. I can able to deploy it successfully by manually starting tomcat server.
When i try to start solr server from within spring mvc web application it says solrserver started,but when i query the solr its giving the following without any errors:
page 0 of 0 containing UNKNOWN instances
As per my research on solr, it is mentioned embedded solrserver is unfit for production so i need to have httpsolrserver.
So somebody help me clear my head and give me some solution...
Thanks in advance..
For production, you would be better with hosting Solr as a seperate instance.
This would keep the responsibility separate, web application and search engine.
Indexing process are resource intensive and would the web application behavior as well.
This can be catered by Master Slave arch, providing best search performance.
External instance can be scaled at will and would not impact the web application.

Deploying an application without undeploying previous one and with no downtime?

I use Glassfish Java, and JSP over MySQL for my web applications. Many online people uses this web application and that web-site should not be down.
When I want to deploy a new war file, I should undeploy and deploy the new one for my application at server.
My question is that;
Is there any technology that doesn't need to undeploy my application and just change the appropriate classes so no need to redoploy it again?
There are java technologies that would allow you to replace classes on the fly (like JRebel). But since you're using Glassfish already, you should just start using clustering which is built into glassfish. You'll need either 2.1 or 3.1, as 3.0 does not support clustering. With a Glassfish cluster, you have a load balancer (Apache, Sun Web Server, hardware (Big IP, Coyote), etc) distribute the load among your cluster nodes. When you want to upgrade the app, you can technically do it one node at a time. Setting up the cluster is not the easiest thing in the world, but it is doable and it would get you some great benefits. You'll be able to scale the load by adding new hardware and even using Amazon (or whoever) cloud services. You'll be able to keep your site running even if the hardware fails on one of the nodes.
Personally I'm in the middle of converting from Glassfish 2.1 to 3.1. So far I like the management of the Glassfish 3.1 cluster much better, but I can't personally vouch for how it will run in production, though I have high expectations.
http://download.oracle.com/docs/cd/E18930_01/html/821-2432/gktqx.html#gktob
Jim is right, the best solution is currently to use a cluster and perform a manual rolling-upgrade.
But there is actually work ongoing to address your needs. We are working on a rolling-upgrade feature in a single standalone instance. To sum up in a nutshell (as the specifications have not been published yet), it will let you switch from an application version to another (see application versioning and the enable command) with no downtime. Stay tuned.