简体   繁体   中英

Java library options to efficiently transfer data between servers?

Scenario:

I have server A and B and data will constantly be transferred from A to B. The addresses of A and B are fixed and known so no naming service is required. The data is like an array list. Each piece will normally be of 10-20 Megabytes containing millions of elements while each element is relatively pretty small.

What Java libraries could be used to efficiently transfer data except JSON marshalling/unmarshalling or object serialization/deserialization (as these are known solutions to me)?

What's wrong with just opening a ServerSocket on one, listen there for a Socket that's requesting a connection from the other, and then write the data as a byte stream?

If you want to be fancy you can create a simple protocol that adds some error checking to the data to be sent, like number of bytes and maybe a hash.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM