Vertx - solution for caching jdbc results... guava?

508 views
Skip to first unread message

lukjel

unread,
Feb 10, 2016, 3:20:49 AM2/10/16
to vert.x
Hi.

In our system we have a lot very frequent jdbc calls. Example: each time main page is displayed - one jdbc call is executed. We want to cache results and refresh data once per 10 seconds.
Creating interval and refreshing in background is not good solution - it produces calls even when it is not needed.
Using guava (and refreshing "on demand") is quite ok, however - guava is not async...

Please, share your ideas...

Lukasz.

Clement Escoffier

unread,
Feb 10, 2016, 3:33:38 AM2/10/16
to ve...@googlegroups.com
Hi,

If you are using Hazelcast as cluster manager, you can use the cache implementation they provide. It has async methods. Apache Ignite also provides an async cache API.
I’ve also started to work on an async version of the JCache API. It’s available here: https://github.com/cescoffier/vertx-cache, and uses “any” JCache implementation that you make available in your classpath.

Clement


--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
Visit this group at https://groups.google.com/group/vertx.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/23b21e56-f7fc-4ecc-ba01-c030a127f3b5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Paulo Lopes

unread,
Feb 10, 2016, 7:08:55 AM2/10/16
to vert.x
If you don't mind to add some more dependencies to your deployment you can also consider redis and use the commands:

* hmset - save an hash
* pexpire - expire the key within ttl

see:

http://redis.io/commands/hmset
http://redis.io/commands/pexpire
Reply all
Reply to author
Forward
0 new messages