1)Is jedis calls synchronous of async? When I make two consecutive writes through jedis, can I be sure that they will hit redis with the same order when I make them?
2)What consistency guarantee does redis provid? When I set some value through jedis, is it guaranteed that every subsequent read will see that write? I know in eventually consistency systems you don't have such guarantee. Is it sequential consistency like zookeeper? I read the document. It just said that it's not strong consistency, which means linearizability I assume?
Is jedis calls synchronous of async?
From the client-server's perspective, it is sync, which means when jedis client send a request, redis server will process it and return the result as the response for the request. But for some command like unlink, things would be different, in some case redis will return directly and process it in background. So whether the command is sync or async, it is depend on redis server's action.
When I make two consecutive writes through jedis, can I be sure that they will hit redis with the same order when I make them?
Yes, redis is single thread model which has a request queue, so all the command is sequential processed. But there are also some cases you should take care of: if more than one clients(or processes) send commands to server, it will occur the thing like data unconsistency. you could use the multi/exec or watch or distributed lock to solve for different cases.
What consistency guarantee does redis provid? When I set some value through jedis, is it guaranteed that every subsequent read will see that write?
if the read command is arrived after the write command, it is guaranteed that read will see that write. It is just because of the single threaded model which make the world simple. But if you use the master-slave mode through the sentinel or redis cluster mode, things will be different. if you read from slave, the read is not guaranteed to see the most recent write because the redis replication from master to slave is async, but the same thing will not occur in the single redis instance.