Whats the difference between using and not using Elasticsearch?

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    SonarQube Latest
  • what are you trying to achieve
    Understanding of why are we using Elasticsearch
  • what have you tried so far to achieve this
    Googling to no avail

Hi, I see that we can try Sonarqube from a docker image without having to set up a ES database, and the template from Sonarsource github does.

The question is, what difference are there between using the raw docker Sonarqube image, and setting up an ElasticSearch database?

Hi @sac ,

in all editions of sonarqube, elasticsearch is bundled and a hard dependency of the application. elasticsearch is managed by sonarqube and you do not need to take care about it from an administrative point of view.

The database question is unrelated to elasticsearch tho. in the getting started command you are utilizing the embedded h2 database as persistent layer, while in the example docker-compose file we reference a real database for the persistent layer (postgresql).
The h2 database should really only be used to evaluate sonarqube as it is not supported for production use.

hope that answers your question

Do you mean I can simply use the docker image sonarqube:latest

instead of having to use the docker-compose.yml linked above and change configs like vm.max_map_count = 524288?

if you just want to try out sonarqube, yes but if you really want to deploy it, No. vm.max_map_count = 524288 is there to fulfill the requirements of sonarqube as documented here: Prerequisites and Overview | SonarQube Docs

If it is to run locally on developers machine with just the intention of analyzing code, then I guess we could make do without the docker-compose?

sure but if this should really just be ran on a local development machine, maybe https://www.sonarlint.org/ might make more sense for you?

Thanks! Will have a look