2

I have developed a small swing desktop application. This app needs data from other database, so for that I've created an small process using java that allows to get the info (using jdbc) from remote db and copy (using jpa) it to the local database, the problem is that this process take a lot of time. is there other way to do it in order to make faster this task ?

Please let me know if I am not clear, I'm not a native speaker.

Thanks

Diego

4
  • 1
    Hi Diego, the question is to broad, try to give us more information. Could you answer this: how big is the remote database, size in MB, nums of tables, how much time (secs) does it take to complete the import and what would be the acceptable time, how fast is the connection between the remote and the local host??? Commented Sep 23, 2012 at 23:47
  • Are you in control of the remote database as well, and if so are they both in a secure network. The speed issue will be mainly sucking the data down in to your client and then pushing it up to your local server. There's not a lot you can do to speed that up. Commented Sep 23, 2012 at 23:51
  • Thanks, for the answer. I did not have experience doing this kind of tasks. Commented Sep 24, 2012 at 0:01
  • Read this answer. It's a similar scenario but the source database is Oracle. Also, you can reuse another tool to handle this work like keetle. Commented Sep 24, 2012 at 0:10

2 Answers 2

1

One good option is to use the Replication feature in MySQL. Please refer to the MySQL manual here for more information.

Sign up to request clarification or add additional context in comments.

2 Comments

Thank for the help. I'm not using the replication because the tables don't have the same structures, local tables have at least 4 more columns.
Then, i think you should try another option which is "The FEDERATED Storage Engine". It is a storage engine that accesses data in tables of remote databases rather than in local tables. Please see here[ dev.mysql.com/doc/refman/5.0/en/federated-storage-engine.html]
0

JPA is less suited here, as object-relational-mapping is costly, and this is bulk data transfer. Here you probably also do not need data base replication.

Maybe backup is a solution: several different approaches listed there.

In general one can also do a mysqldump (on a table for instance) on a cron task compress the dump, and retrieve it.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.