apache / apache/brpc

mongodb client 支持

Open
#1,807 0 comments 0 reactions 0 assignees View on GitHub
feature
Dominant language
C++
Stars
17.6k
Forks
4.1k
Avg merge
2d 12h
Merged PRs (30d)
69

Description

**Is your feature request related to a problem? (你需要的功能是否与某个问题有关?)**
brpc支持请求mongodb服务,支持副本集。

**Describe the solution you'd like (描述你期望的解决方法)**
实现[MongoDB Wire Protocol](https://www.mongodb.com/docs/manual/reference/mongodb-wire-protocol/),使用Request Opcode `OP_MSG`。添加InsertRequest/Response,QueryRequest/Response,GetMoreRequest/Response(游标操作),CountRequest/Response,DeleteRequest/Response,UpdateRequest/Response,FindAndModifyRequest/Response protobuf定义,`PackRequest`转换为Mongo OP_MSG,`ProcessResponse`将解析Mongo OP_MSG,转换为pb。
副本集功能的支持,添加一个`NamingService`通过`replSetGetStatus`获取副本集中的各个节点的状态,返回`PRIMARY`节点。

**Describe alternatives you've considered (描述你想到的折衷方案)**
MongoDB文档没有详细描述CRUD操作的协议,因此可以通过编写MongoDB CRUD测试程序抓包模仿实现。

**Additional context/screenshots (更多上下文/截图)**
现在已经实现了mongo insert, find, getMore, count, delete, update, findAndModify操作,能够支持副本集(只会使用PRIMARY节点)

Contributor guide

Open the contributing guide

Research direction

Search the brpc repository for the MongoDB client implementation described in the issue, starting with its MongoDB Wire Protocol OP_MSG handling. Check whether insert, find, getMore, count, delete, update, findAndModify, and replica-set PRIMARY selection are already present. Done means these operations and replica-set support are implemented and validated by CRUD and replica-set tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, mongodb
Domain
backend, databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
15/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.