I have built a mysql cache using ElasticSearch, I am not sure if anybody
else using ES in this way, but it really works for me.
My motivation is from two concerns in terms of mysql:
1. max connection number of mysql limits concurrent access when massive
users read database.
2. search is hard, especially I need to perform search through http API.
so I built a framework which automatically indexes database records to
ES whenever a row gets created/updated/deleted. The trick is
Spring TransactionSynchronization, each time a transaction commit complete,
the callback triggers an index operation.
it works quite well so far, at least in my unit test. However, I still
have some concerns:
1. Will frequent index screw ES? when database update frequently, let's
say 10000 users update database concurrently, and mysql max connection is
2000. This means I may do ES index 2000 times per second. Will this burden
ES too much? The max documents will be 1.5 million, I would not support any
number bigger than this.
2. how can I reduce refresh time? As I use ES as cache, which means all
read operation will perform to ES instead of mysql. When users update
database, they expect to see the update immediately in next read operation.
Now I set refresh interval to 500ms and add 300ms delay in search
operation. This works, but I am still afraid that sometime user will read
old data as the delay is smaller than refresh interval. I wonder if setting
refresh interval 100ms can make things better?
3. how to make index faster? In my test, indexing a 4K document takes
~120ms. Comparing to writing database it is slow but still acceptable.
However, my unit test only create about 20 documents, I am afraid the index
time will increase significantly if there are millions document. Is there
any way I can make it faster? for example, creating schema for each index?
I used to build my framework on Solr until I found ES, now I will
never look back. Hope you guys keep improving this awesome project!
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firstname.lastname@example.org.
For more options, visit https://groups.google.com/groups/opt_out.