C
C#2mo ago
Félix An

Trying to make a "Distributed SQLite" in C# and gRPC/Protobuf - don't know what to do next

Hello, for a project that I am required to do, I need to make a simple distributed database system demo, so I thought of making distributed SQLite in C# using gRPC/Protobuf for network communication. (The teacher recommended gRPC because he said it's faster than HTTP REST APIs.) My setup would have nodes connected to the master server (coordinator). The coordinator has a list of all the tables and the IP address and port number. Whenever you want to create a table, you ask the coordinator, and it will create an identical table across at least three nodes (if less than three are available, all the nodes). Then, you call the appropriate function to perform CRUD operations on the table to the coordinator, and it will tell all the nodes containing the respective tables to carry out the same operations. So far, I am a little lost. I assume I need to first create a Protobuf file that defines all the database operations over the network that I can possibly do. I used the same message for all NonQueryResponse and QueryResponse, similar to the way C# does .ExecuteNonQuery() for all non-query operations. Since gRPC doesn't seem to support transmitting 2D tables, I thought of a "hack"/workaround where the dimensions of the result-set table and data types of the columns are first transmitted, then the cells of the table are transmitted in serial order from left to right, top to bottom, and placed back into a 2D DataTable on the receiving end. But now I feel like my .proto file is missing something or wrong, and I also am lost on what to do next. I have no idea how to use gRPC, and I tried watching many videos on it. I also have no idea what is the proper way I should structure my "distributed" database. Could someone please point me in the right direction? Thanks! Please try to explain to me as detailed as possible, as I'm completely lost. P.S. The project is due on May 20. Is it reasonable for me to finish it (at least 85% of the desired functionality) by then?
1 Reply
Félix An
Félix An2mo ago
GitHub repo: https://github.com/fffelix-jan/LiteDist The .proto file in question (database.proto)
GitHub
GitHub - fffelix-jan/LiteDist: A VERY rudimentary demonstration of ...
A VERY rudimentary demonstration of a "distributed" database using C#, gRPC and SQLite for a class in Zhejiang University. (WIP) - fffelix-jan/LiteDist