MyBatis and Apache Ignite integration

78 views
Skip to first unread message

dma...@gridgain.com

unread,
Jan 21, 2016, 11:08:38 AM1/21/16
to mybatis-user, d...@ignite.apache.org
Hi MyBatis community!

I'm a committer and PMC of Apache Ignite [1] project and writing to you on behalf of our community (+ CC-ed) to discuss an integration between our projects that should be useful for both sides.

In short, Apache Ignite is a high-performance, integrated and distributed in-memory platform for computing and transacting on large-scale data sets in real-time, orders of magnitude faster than possible with traditional disk-based or flash technologies.
Inside of our community we see a growing interest in a field of usage MyBatis along with Apache Ignite. There are use cases when developers/users wants to use Apache Ignite as MyBatis second level cache. Since such an interest is growing constantly we think that it's a right time to make this happen.

As I see MyBatis already supports second level cache for Redis, Hazelcast and Ehcache.

How do you usually add such components? Were they added by MyBatis guys or were developed by guys from Redis, Hazelcast, etc.? 


Regards,
Denis

Eduardo Macarron

unread,
Jan 22, 2016, 4:46:08 PM1/22/16
to mybati...@googlegroups.com
Hi Denis,

First of all. Wellcome to the list!

AFAIK all the cache integration plugins have been developed by ourselves. The interface is quite easy so the task is usualy pretty straight forward. 

I will be very happy to help with the integration! I would suggest creating a new repo and work on it. Probably it will be better that that someone from the Ignite project builds the plugin and we provide information about how the interface works. 

Regarding the future hosting, I suppose there will be no problem in hosting the new project at our home in Github but is also perfect that you host it as part of the ignite project. No problem at all with any option!

Looking forward to starting! :)

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mybatis-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

dma...@gridgain.com

unread,
Jan 23, 2016, 3:28:27 AM1/23/16
to mybatis-user, d...@ignite.apache.org
Hi Eduardo,

It's nice to hear from you! Thanks the help and details!

Absolutely agree with you that the interface is straightforward and I don't see any difficulties that can arise during its implementation.
I'll open an Apache Ignite JIRA ticket soon describing the integration details and hope that someone from Ignite community will pick it up the next week starting working on the plugin.

As per the hosting I would host everything on MyBatis GitHub repo as it is already done for other plugins and in addition would add a documentation to Apache Ignite [1]. This way both MyBatis and Ignite community will be aware about the integration and we don't need to host the plugin in different repos.

I've copied Ignite dev community to the discussion - d...@ignite.apache.org. So please make sure that this dev list is copied when you reply ;)

If someone else from either MyBatis or Ignite community has any thoughts on this topic please share.

Denis

Denis Magda

unread,
Jan 25, 2016, 11:16:09 AM1/25/16
to mybatis-user, d...@ignite.apache.org
HI All,

I've opened an Ignite ticket with tasks description [1]

Is there anyone in Apache Ignite community who is interested in this kind of work and will be able to complete it in the nearest couple of weeks?

[1] https://issues.apache.org/jira/browse/IGNITE-2448

Regards,
Denis
You received this message because you are subscribed to a topic in the Google Groups "mybatis-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mybatis-user/CxSqG1dprm4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mybatis-user...@googlegroups.com.

Eduardo Macarron

unread,
Jan 27, 2016, 12:35:45 PM1/27/16
to mybati...@googlegroups.com, d...@ignite.apache.org
Hi Denis, and people from the ignite project.

I have just created an empty project at Github for the integration:

As we spoke before, the interface is really simple. Probably we may have gone too far with the simplicity because some things need to be explained.

The cache adapter just needs to implement the Cache interface:

One instance of this class is created for each namespace. The namespace is an String received as a paremeter to the constructor:

  public IgniteCache(String id) {
    super();
    this.id = id;
  }
  
The namespace is just a set of statatements. They are held in the same mapper xml file or in the same mapper interface. From the cache perspective, all the statements in a namespace have only one thing in common: they are flushed all together and share the same properties (like eviction policy, size...)

There is no special method to bootstrap the underlying cache system so this has to be done in an static block. See the Redis cache adapter for an example:

Properties are read from the cache elament and passed to any setter method in the adapter class. The code is here:

Hope this basic info is enough to start.

Apart from that... the only condition is that any code contributed will be licensed under the Apache License 2.0 which I suppose that is not going to be a problem ;)

And that we can start with pull requests but have no problem at all in giving direct commit rights to the creator (or creators) of the plugin.

Regards.

dma...@gridgain.com

unread,
Jan 28, 2016, 3:29:07 AM1/28/16
to mybatis-user, d...@ignite.apache.org
Hi Eduardo,

Thanks a lot for the assistance! Added a reference to this discussion into task's ticket [1] so that the one who will be implementing the plugin will be able leveraging the details discussed here.

As for Apache 2.0 license, sure, there is no any problem with this ;)
 

Regards,
Denis

Denis Magda

unread,
Jan 28, 2016, 4:47:36 AM1/28/16
to d...@ignite.apache.org, mybatis-user
Roman,

Perfect, thanks a lot! Please work close with Eduardo if you need to
know more details on myBatis.

--
Denis

On 1/28/2016 12:45 PM, Roman Shtykh wrote:
> Denis,
>
> I will take care of this integration.
>
> -Roman
>> 2016-01-21 10:30 GMT+01:00 <dma...@gridgain.com <javascript:>>:
>> <javascript:>.
>> For more options, visit https://groups.google.com/d/optout
>> <https://groups.google.com/d/optout>.
>>
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "mybatis-user" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/mybatis-user/CxSqG1dprm4/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> mybatis-user...@googlegroups.com
>> <mailto:mybatis-user...@googlegroups.com>.
Reply all
Reply to author
Forward
0 new messages