I’m developing an ASP.NET MVC 4 commerce site but since my background is in front-end web dev with HTML/CSS/Javascript and C# with XNA all this server and database business is doing my head in.
At the moment the site uses an elasticsearch Index with NEST to perform searches for products since the products db is huge and I like the smart queries elasticsearch offers. And that all works great on my local testing environment.
My question is: is it generally a good idea to have your elasticsearch client and indices stored on a separate host from the actual site or is it OK to have it on the same server?
I understand there’s the issue of space at play here, but I’ve heard elasticsearch queries also tie up server resources that could be better spent handling other tasks like the impending flood of payments that are sure to come through?
It really depends on your load, your data and your current server. How many users do you have on your website? How big is your index? How powerful is your current server?
It’s usually best practice to put elasticsearch on a separate machine, even more than one in order to talke advantage of its distributed features. With two machines you can for example distribute your shards over them and configure one replica (default value), so that every machine contains a whole copy of the data. And if the load increases you can always add new nodes to the cluster, as long as you allocated enough shards (it’s common practice to over-allocate shards a little).
On the other hand, I’ve also used it embedded in a Java application, as you can read in this article I recently wrote.