Live data from Hacker News

How we get high availability with Elasticsearch and Ruby on Rails

18f.gsa.gov

11–20 of 30 posts

Re: How we get high availability with Elasticsearch and Ruby on Rails

#11

Is this sort of parallelism also doable with Solr as well?

I don't see why it wouldn't be. The main differentiator between Solr and Elastic Search is that ES handles constant incoming data more consistently, so it's a much better fit for realtime scenarios.

Just batch loading the data one time shouldn't create much of a problem for Solr either.

Re: How we get high availability with Elasticsearch and Ruby on Rails

#12
"27 reports per second" what?

I use bulk api with .net Nest client.

I can easily put 1000 documents per second (which also include 3-10 nested documents) with 4core i5 machine. Serialization is the cheapest operation in my case. I would blame ruby in your workflow.

Re: How we get high availability with Elasticsearch and Ruby on Rails

#13
post #3

Elasticsearch is awesome. It may be a good idea to use the bulk API that is built into elasticsearch, use some joins in your SQL query, and index more than just one record at a time. In the implementation I have, I batched my query to 50,000 records at a time that then index into elasticsearch. For the 2.7 million records I indexed this week, it took a total of 54 queries to the database (50,000 records returned at a…

I started using elasticsearch recently and I was wondering, does the indexing happen in real time during the index request? How do you know how long the indexing process takes?

Re: How we get high availability with Elasticsearch and Ruby on Rails

#14
post #9

I have no idea why the phrase "high availability" is in this post.

>We call these extensions "high availability" because this approach means that re-indexing a production system can happen much faster, reducing downtime for our users.

Agree with their use of the term or not, they give you their reasoning at the end of the article.

Re: How we get high availability with Elasticsearch and Ruby on Rails

#15
post #6

Earlier quoted context omitted.

Do you mind sharing how long it took for the indexing portion?

It took me about 20 minutes to index 2.7M records. It was pulling from 3 tables using joins, and using the .Net NEST client.

if you are using MSSQL or maybe other XML supported RDBMS, I highly suggest xml subqueries instead of joins. You can actually return whole object graph in one row, it is impossible with traditional sql. It is not too complicated either.

Re: How we get high availability with Elasticsearch and Ruby on Rails

#16
post #14
post #9

I have no idea why the phrase "high availability" is in this post.

>We call these extensions "high availability" because this approach means that re-indexing a production system can happen much faster, reducing downtime for our users. Agree with their use of the term or not, they give you their reasoning at the end of the article.

That's crazy misleading. This is just a post saying, "hey, this is a way to sync data faster." Awesome! Much kudos.

But stale data isn't "downtime." This is tech marketing at like, MongoDB level.

Re: How we get high availability with Elasticsearch and Ruby on Rails

#17
post #13
post #3

Elasticsearch is awesome. It may be a good idea to use the bulk API that is built into elasticsearch, use some joins in your SQL query, and index more than just one record at a time. In the implementation I have, I batched my query to 50,000 records at a time that then index into elasticsearch. For the 2.7 million records I indexed this week, it took a total of 54 queries to the database (50,000 records returned at a…

I started using elasticsearch recently and I was wondering, does the indexing happen in real time during the index request? How do you know how long the indexing process takes?

It happens pretty much real time. While using cURL or the .NET client it doesn't return a response until the indexing is finished. You can verify this by querying your index for some basic info. For example you could even just put the following in the browser:

http://hostname:9200/_cat/indices

The 6th column gives you the number of records indexed. Send your request and refresh the browser.

Re: How we get high availability with Elasticsearch and Ruby on Rails

#18
post #13
post #3

Elasticsearch is awesome. It may be a good idea to use the bulk API that is built into elasticsearch, use some joins in your SQL query, and index more than just one record at a time. In the implementation I have, I batched my query to 50,000 records at a time that then index into elasticsearch. For the 2.7 million records I indexed this week, it took a total of 54 queries to the database (50,000 records returned at a…

I started using elasticsearch recently and I was wondering, does the indexing happen in real time during the index request? How do you know how long the indexing process takes?

There's an index.refresh_interval setting. It defaults to 1s, so by default your data will be available for querying within one second after being indexed.

Re: How we get high availability with Elasticsearch and Ruby on Rails

#19

"27 reports per second" what? I use bulk api with .net Nest client. I can easily put 1000 documents per second (which also include 3-10 nested documents) with 4core i5 machine. Serialization is the cheapest operation in my case. I would blame ruby in your workflow.

Seriously depends on the structure of the documents and your analyzer setup. I agree that it should be in hundreds recs per sec though.

Re: How we get high availability with Elasticsearch and Ruby on Rails

#20
post #14

Earlier quoted context omitted.

>We call these extensions "high availability" because this approach means that re-indexing a production system can happen much faster, reducing downtime for our users. Agree with their use of the term or not, they give you their reasoning at the end of the article.

That's crazy misleading. This is just a post saying, "hey, this is a way to sync data faster." Awesome! Much kudos. But stale data isn't "downtime." This is tech marketing at like, MongoDB level.

Except it's not marketing from the vendor in question. This is a page by the US government.
Post reply on HN