alibaba / alibaba/GraphScope

Adding Async Feature to GRIN

Open
#2,639 1 comment 0 reactions 0 assignees View on GitHub
enhancement summer-of-code
Dominant language
C++
Stars
3.6k
Forks
468
Avg merge
29m
Merged PRs (30d)
1

Description

I would like to request the addition of an asynchronous feature to the GRIN graph retrieval APIs. The async feature would allow for more efficient and non-blocking I/O operations, which would improve the overall performance of the graph computing engine.

**Designing the Async APIs of GRIN**

To design the async APIs of GRIN, we need to consider what kind of operations we want to support and how we can make them asynchronous. According to the GRIN project, it provides a set of graph retrieval APIs for graph computing engines to access various storages in a uniform way. Therefore, we need to think about how to make these APIs asynchronous. We can start by looking at the existing synchronous APIs and consider how we can modify them to work asynchronously.

**Proof-of-Concept the API design by implementing the APIs using the async capability of RocksDB**

We will use the C/C++ APIs of RocksDB to implement the async capability of GRIN. To make these APIs asynchronous, we may utilize the **async** and **await** keywords in C++20, which allow us to write asynchronous code using coroutines. A coroutine is a special kind of function that can be paused and resumed, allowing other code to run in the meantime. This makes it possible to write code that can perform I/O operations without blocking.

To implement the async APIs using the async capability of RocksDB, we can use the rocksdb library in C++, which provides an asynchronous API for RocksDB. We can start by writing some simple test cases that use the async API to read and write data to RocksDB. We can then use these test cases to verify that the async API is working correctly.

**Conclusion**

In summary, to add the async feature to GRIN, we need to design the async APIs of GRIN using C++20 coroutines, and implement the APIs using the async capability of RocksDB by using the rocksdb library in C++. We can also use the boost::asio library to create a simple TCP server to test the async API in a more realistic scenario.

We believe that this feature will greatly benefit the GRIN project and help improve its performance. We welcome any feedback and suggestions on this feature request.

Thank you for your consideration.

Contributor guide

Open the contributing guide

Research direction

No files, tests, or entry points are named. Start by locating GRIN's existing synchronous graph retrieval APIs and the RocksDB integration, then review the proposed C++20 coroutine and async API design; done would require an agreed API design and a working proof of concept with tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.