Professional Documents
Culture Documents
Arun Rajan, Ethan (Zhexin) Qiu, Esther (Cuiping) Fang, Purva Kamat
One improvement we did is to leverage the 1. Distributed sqlite clients enter the Raft
natural property of the SQLite (or any database group id involved in the distributed
management engine) which already stores the transaction and the corresponding sql
state machine state in stable storage. Instead of commands for each Raft group. It will
creating actual snapshots, we just created a soft create a Distributed Transaction request
link to the already existing SQLite database and the request will be sent to the
files. This avoids the need for duplication and coordinator.
2. The coordinator will send a PREPARE In case of machine failure, the coordinator and
message to the leaders of Raft groups participants use local log
involved in the transaction. By using (LogRecordRepository) to recover all the
Raft, the sql commands received by the unfinished transactions. LogRecordRepository
leader will be replicated by all followers stores all the transaction information.
in the group.
3. After sending VOTE requests to If a participant votes ‘Yes’ and crashes after
participants. sending ‘Yes’ to the coordinator, it is highly
a. The coordinator records this likely that a leader election would have
transaction into the local log. happened before the server recovers from the
b. Upon receiving a PREPARE crash. Because of the consistency guarantee of
request from coordinator, all the Raft consensus, the next leader is guaranteed
participants will record it and to know PREPARE operation. The next leader
execute the SQL queries in the has to check the local LogRecordRepository for
state machine without any transaction not in final state ( not in Abort or
committing in the database. If it Commit). If the participant votes ‘No’ for the
fails, the participant will transaction then it can safely record the decision
respond No to the coordinator, as Abort, otherwise it needs to contact the
otherwise it will return Yes. coordinator to get the final decision of the
And participants will record the transaction and apply it on its state machine. I f
vote result in the local log. the coordinator fails, participants will abort any
4. After receiving votes from participants, transactions that are not in final state.
The coordinator will decide the outcome
and send it to participants and record 4. Benchmark and Performance
this in the local log. We performed benchmarking against Rqlite and
5. Upon receiving a Decision, participants SQLite. Rqlite is also a replicated sqlite
will commit or abort the transaction database[6] built using Raft.
accordingly and record the outcome in
the log. We have included our benchmark datasets and
6. Once the coordinator reaches a decision, commands to perform testing in the git
it will reply to the client with the repository. The tests that compare with Rqlite
outcome of distributed transaction and perform distributed transactions were done
(COMMIT or ABORT) locally on a personal machine with 16 GB
memory & 3.1 GHz Intel Core i7 processor. The
comparison with SQLite was performed on a
personal machine with 8 GB memory & 1.6
GHz processor.
Numb
er of
10 50 100 500 1000 1500
Recor
ds
We observe that Distributed SQLite outperforms DSQ 0.772 4.004 33.71 64.97 95.11
7.758
Rqlite in terms of speed of handling write Lite 4 6 03 13 53
requests. We believe the difference in time is
mainly caused by optimization done in the 4.3 Comparing Strong Read and Weak
underlying raft library that we used[2]. Read in Distributed SQLite