eBay / NuRaft

C++ implementation of Raft core logic as a replication library
Apache License 2.0
1.02k stars 241 forks source link

client-service model quesiton #369

Closed BozeBro closed 2 years ago

BozeBro commented 2 years ago

If we wanted to separate the client from the server, like the client sends requests over a network, is there a way to do that in this library or does this require our own separate implementation?

greensky00 commented 2 years ago

This library has such a protocol to handle client requests over the network: https://github.com/eBay/NuRaft/blob/50031e1b230569ccaa46008fc09d401e3e5c5985/src/raft_server.cxx#L636-L639 but we don't recommend it as it is inconvenient and lack functionalities such as error handling and throttling.

In eBay, we use our own server-client implementation using gRPC or REST API, and the server operates NuRaft with local append_entries() API call.

BozeBro commented 2 years ago

Does a client implementation exist in the library or is this also left up to the developer?

greensky00 commented 2 years ago

It is not in the library, you should write your own one with Asio.