You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by beginner miau <kk...@yahoo.com> on 2017/11/16 15:47:22 UTC

JDBC Client

Hi, I am beginner with Apache Ignite and have few questions related to JDBC.
1. Let's say I have 2 node in 2 different machine (cache mode = replicated,
native persistence is turned on). I want to connect to the Apache Ignite
server using JDBC thin client. In the JDBC thin client URL, I only can
specify one IP and port. If the node I connected to is down, will the JDBC
connection connects to the other node automatically? If the answer is no,
just curious how to automatically make the connection point to the other
node? 2. Same scenario as above, how about using the  JDBC thick client? 3.
Let's say initially I start Apache Ignite with only one node (cache mode =
replicated, native persistence is turned on). And start populate data into
the cache/table. Now my server node has few millions data. Then I started
another node in another machine. The data will automatically replicated to
this new node? How long will it take? Thanks in advanced. Regards, Miau



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: JDBC Client

Posted by Mikhail <mi...@gmail.com>.
Hi again,

>1. If use thick driver, can we use JDBC connection pooling? 
no, you should not use connection pools in this case. ignite client which is
used by the thick driver 
is concurrent save and can be used by multiple threads and communicate with
any server from the cluster.

>2. How/What is the process to backup the data in Apache Ignite? 
what do you mean by backups? you can set backups number to cache
configuration and cluster will store extra copies of you data, so you will
be protected from node failure
https://apacheignite.readme.io/docs/primary-and-backup-copies

to protect your data from cluster failure you can use disk persistance:
https://apacheignite.readme.io/docs/distributed-persistent-store

there's 3rd party commercial solution for creating snapshots which can be
saved on some ntf dir.

Also, you propagate data from a cluster to other databases:
https://apacheignite.readme.io/docs/3rd-party-store

>3. Let's say initially I start Apache Ignite with only one node (cache mode 
>= replicated, native persistence is turned on). And start populate data
into 
>the cache/table. Now my server node has few millions data. Then I started 
>another new node in another machine. The data will automatically replicated 
>to this new node. What will happen if I have a client that connect to this 
>new node and the replication of data is not yet finish? 

if you configure the only second server in client's discovery configuration,
then the client will connect to the second server, but the client can
communicate directly with all server in your cluster, so even if there's
still no data on the second server, the client can read data from the first
server.

ignite is the strongly consistent system, your client will read data from
the first server and only when all data are copied to the second server, the
client will be able to read them from the second server.
The real mechanism is more complicate because ignite will split data by
partitions and move partitions to a new server and when a partition is
migrated ignite will allow it to be read by client, but any way client
always can read only consistent data, there's no way that client can read
only the half of data and miss another.






--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: JDBC Client

Posted by beginner miau <kk...@yahoo.com>.
Hi Mike,

Thanks for the reply and explanation.
I have further curious question.
1. If use thick driver, can we use JDBC connection pooling?
2. How/What is the process to backup the data in Apache Ignite?
3. Let's say initially I start Apache Ignite with only one node (cache mode
= replicated, native persistence is turned on). And start populate data into
the cache/table. Now my server node has few millions data. Then I started
another new node in another machine. The data will automatically replicated
to this new node. What will happen if I have a client that connect to this
new node and the replication of data is not yet finish?

Regards,
Miau



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: JDBC Client

Posted by Mikhail <mi...@gmail.com>.
Hi Miau,

1. no, thin client won't reconnect to cluster, you need to handle an
exception and re-connect to other servers manually.
I create a ticket to improve this part:
https://issues.apache.org/jira/browse/IGNITE-6942

2. Thick driver uses ignite instance under the hood, so ignite client will
try to re-connect to other server node from a list from discovery
configuration.

3. yes, it will: https://apacheignite.readme.io/docs/rebalancing
I can't say anything about a time, it depends on your data size, network and
configuration.

Thanks,
Mike.



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/