Slick and Ignite

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Slick and Ignite

Ognen Duzlevski
Can anyone offer any opinion on what it would take to make Slick (
http://slick.typesafe.com/) work with Ignite? (I just stumbled upon Slick
and it looks very nice, apologies if this had already been discussed).
Given that Ignite exposes the caches via SQL - they just seem like a match
made in heaven.

Thanks!
Ognen
Reply | Threaded
Open this post in threaded view
|

Re: Slick and Ignite

Andrey Gura
Ognen,

in order to use Slick (or any similar framework) you need just configure
JDBC connection to the Ignite cluster using Ignite JDBC driver. See
documentation - http://apacheignite.readme.io/v1.1/docs/jdbc-driver.

In case of Slick you can configure as follows:

val db = Database.forURL("jdbc:ignite://localhost:11211/<cache_name>",
driver="org.apache.ignite.IgniteJdbcDriver")


After it you can execute any read-only SQL queries.

Please note that Ignite JDBC URL contains cache name as database schema
name. If you want execute queries for different caches you should configure
different data sources or use cross cache queries.

Andrey.

On Wed, Jun 24, 2015 at 6:09 AM, Ognen Duzlevski <[hidden email]>
wrote:

> Can anyone offer any opinion on what it would take to make Slick (
> http://slick.typesafe.com/) work with Ignite? (I just stumbled upon Slick
> and it looks very nice, apologies if this had already been discussed).
> Given that Ignite exposes the caches via SQL - they just seem like a match
> made in heaven.
>
> Thanks!
> Ognen
>



--
Andrey Gura
GridGain Systems, Inc.
www.gridgain.com
Reply | Threaded
Open this post in threaded view
|

Re: Slick and Ignite

Ognen Duzlevski
Andrey, this is pretty nice - thanks! I was hoping it could just "plug and
play" out of the box :)
Ognen

On Wed, Jun 24, 2015 at 4:56 AM, Andrey Gura <[hidden email]> wrote:

> Ognen,
>
> in order to use Slick (or any similar framework) you need just configure
> JDBC connection to the Ignite cluster using Ignite JDBC driver. See
> documentation - http://apacheignite.readme.io/v1.1/docs/jdbc-driver.
>
> In case of Slick you can configure as follows:
>
> val db = Database.forURL("jdbc:ignite://localhost:11211/<cache_name>",
> driver="org.apache.ignite.IgniteJdbcDriver")
>
>
> After it you can execute any read-only SQL queries.
>
> Please note that Ignite JDBC URL contains cache name as database schema
> name. If you want execute queries for different caches you should configure
> different data sources or use cross cache queries.
>
> Andrey.
>
> On Wed, Jun 24, 2015 at 6:09 AM, Ognen Duzlevski <
> [hidden email]>
> wrote:
>
> > Can anyone offer any opinion on what it would take to make Slick (
> > http://slick.typesafe.com/) work with Ignite? (I just stumbled upon
> Slick
> > and it looks very nice, apologies if this had already been discussed).
> > Given that Ignite exposes the caches via SQL - they just seem like a
> match
> > made in heaven.
> >
> > Thanks!
> > Ognen
> >
>
>
>
> --
> Andrey Gura
> GridGain Systems, Inc.
> www.gridgain.com
>
Reply | Threaded
Open this post in threaded view
|

Re: Slick and Ignite

dsetrakyan
In reply to this post by Andrey Gura
> Please note that Ignite JDBC URL contains cache name as database schema
> name. If you want execute queries for different caches you should configure
> different data sources or use cross cache queries.
>

Andrey, I am not sure what different data sources you are describing here.

The cache name in the JDBC connection is only to specify the default cache
for query access. This only means that classes belonging to other caches
will have to be prefixed in the queries by the cache name. For example, in
the following query, we have to specify "orgsCache" name explicitly,
because it was not specified in the initial JDBC connection string.


-------
select * from Person p, "orgsCache".Organization o where p.orgId = o.id and
...
-------

D.
Reply | Threaded
Open this post in threaded view
|

Re: Slick and Ignite

Andrey Gura
Dmitry,

I repeated experiment using Ignite JDBC driver with default cache in URL
and CacheQueryExample (cache names was modified) and found the following
results:

1. If default cache isn't started then driver can't establish connection
with error message "Client is invalid. Probably cache name is wrong." There
is test for this case (see JdbcConnectionSelfTest.testWrongCache).
2. If default cache is started then query fails on the server side with
error message "Indexing is disabled for cache: null. Use setIndexedTypes or
setTypeMetadata methods on CacheConfiguration to enable"
3. If JDBC URL contains cache name which have indexing configuration then
all queries with cache name prefixes work correctly.

Andrey.

On Wed, Jun 24, 2015 at 6:48 PM, Dmitriy Setrakyan <[hidden email]>
wrote:

> > Please note that Ignite JDBC URL contains cache name as database schema
> > name. If you want execute queries for different caches you should
> configure
> > different data sources or use cross cache queries.
> >
>
> Andrey, I am not sure what different data sources you are describing here.
>
> The cache name in the JDBC connection is only to specify the default cache
> for query access. This only means that classes belonging to other caches
> will have to be prefixed in the queries by the cache name. For example, in
> the following query, we have to specify "orgsCache" name explicitly,
> because it was not specified in the initial JDBC connection string.
>
>
> -------
> select * from Person p, "orgsCache".Organization o where p.orgId = o.id
> and
> ...
> -------
>
> D.
>



--
Andrey Gura
GridGain Systems, Inc.
www.gridgain.com