0

We have an ad search website and all the searches are being done through entity framework directly querying the sql server database.

It was working very well when the database had around 1000 ads, but now it is reaching 300k and lots of users searching. The searches now are very slow (using raw sql didn't help much) and I was instructed to consider Elasticsearch.

I've been some tutorials and I get the idea of how it works now, but what I don't know is:

  1. Should I stop using sql server to store the ads and start using Elasticsearch instead? What about all the other related data? Is Elasticsearch an alternative to sql server?
  2. Each Ad has some related data stored in different tables, how would I load it to Elasticsearch? As a single json element?
  3. I read a lot of "billions of data" handled by Elasticsearch, so I don't think I would have performance problems with 300k rows in it, correct?

Would anybody explain me better these questions?

1 Answer 1

1

1- You could still use it; you don't want to search over the complete database, rigth? Just over the ads. It works with a no-sql format, so it is very scalable. It also works with json's so you have an easy form to access it.

2- When indexing data, you should try to add the complete necessary data in the same document(sql row), which is a single json, but in a limited way. Storage is cheap, but computing time isn't.

To index your data, you could either use filebeat, a program a bit similar to logstash, or create your own solution like, making a program that reads data from your db, and then passes it to elasticsearch in bulks.

3- Correct, 300k rows is a small quantity, but it also depends on the memory from where you are hosting elasticsearch.

Hope this helps.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks Josué, so Elasticsearch would be a read-only database that gets updated every X time through this filebeat or something else you mentioned?
@user3900456 not read-only. You can still perform CRUD operations through json calls.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.