- 快召唤伙伴们来围观吧
- 微博 QQ QQ空间 贴吧
- 文档嵌入链接
- 复制
- 微信扫一扫分享
- 已成功复制到剪贴板
Deep Dive#2 API 与 Python SDK
Deep dive是由Milvus社区发起的代码解析系列直播,针对开源数据库 Milvus 整体架构开放式解读,与社区交流与分享 Milvus 最核心的设计理念。
对本期内容感兴趣的小伙伴,想要和讲师实时QA,欢迎大家添加小助手微信:Zilliz-tech 备注”直播“加入讨论群与大家共同交流!
分享大纲:
- 为什么讲 PyMilvus 和 Milvus protocol API?
- protocol API
- PyMilvus 代码深入
- PyMilvus 发展目标和计划
展开查看详情
1 .Milvus Deep Dive#2 APIs and Python SDKs Xuan Yang xuan.yang@zilliz.com
2 . Xuan Yang - Zilliz software engineering - Graduated from WHU - In charge of PyMilvus and Milvus DataNode - Crazy fan of open-source community PyMilvus-admin - Crazy fan of Vim Milvus-contributor
3 .WhyAPIs and Python SDK?
4 . gRPC SDKs Milvus Milvus protocol API
5 . PyMilvus Nodejs SDK Java SDK milvus.proto common.proto Milvus schema.proto Go SDK Restful APIs CPP SDK Milvus SDK roadmap https://milvus.io/docs/v2.0.0/roadmap.md#SDK
6 . What’s the actual behavior of Milvus milvus.proto How common.proto New features schema.proto PyMilvus uses those APIs in PyMilvus combined by different APIs New SDK implementation
7 .O bject R elational M apping PyMilvus 2.0
8 .Milvus protocol API
9 .Milvus protocol API milvus.proto common.proto schema.proto
10 . milvus.proto common.proto schema.proto milvus.proto ... service MilvusService{ ... rpc CreatePartition(CreatePartitionRequest) returns (common.Status) {} ... } ... message CreatePartitionRequest { ... string collection_name = 3; string partition_name = 4; } ...
11 . milvus.proto common.proto schema.proto common.proto message Status { ErrorCode error_code = 1; string reason = 2; }
12 . milvus.proto common.proto schema.proto schema.proto message CollectionSchema { string name= 1; string description = 2; bool autoID = 3; repeated FieldSchema fields = 4; }
13 . Combination of APIs create_index() as an example rpc DescribeCollection() rpc CreateIndex() rpc GetIndexState() What you want might not even need to change the behavior of Milvus server.
14 .PyMilvus 2.0
15 .PyMilvus 2.0 ORM —— More in one ORM-style API Documentations Roadmaps
16 .ORM —— More in one ORM-style API Documentations Roadmaps Object-Relational Mapping Operate directly on objects. Isolate business logic and data access details. Hide the implementation complexity, same codes everywhere.
17 .ORM —— More in one ORM-style API Documentations Roadmaps Hide the implementation complexity, same codes everywhere. PyMilvus Milvus as a DBS rpc ORM-style cython Milvus as a library codes ... Milvus as a cloud service
18 . ORM —— More in one ORM-style API Documentations Roadmaps Control connections to Milvus ... connections.add_connection( Add Milvus addresses dev={“host”: “localhost”, “port”: “19530”}, cloud={“host”: “xxx.xxx.xxx”, ”port”: “xxxxxx”}, ) Connect to one server using alias “dev” connections.connect(“dev”) Disconnect to the server using alias “dev” connections.disconnect(“dev”) Remove one address connections.remove_connection(“dev”) using alias “dev”
19 . ORM —— More in one ORM-style API Documentations Roadmaps Operating directly on Collections, Partitions, and Indexes ... Binding Collection films = Collection(“films”, ..., using=“dev”) object with connection films.name Collection object has states films.description films.num_entities ... films.insert(...) films.load() Operate on the Collection object films.search(...) films.query(...)
20 . ORM —— More in one ORM-style API Documentations Roadmaps Operating directly on Collections, Partitions, and Indexes ... Create a partition in adventure = films.create_partition(“adventure”) films collection adventure.name adventure.description Partition object has states adventure.is_empty ... adventure.insert(...) adventure.load() Operate on the Partition object adventure.search(...) adventure.release(...)
21 . ORM —— More in one ORM-style API Documentations Roadmaps Operating directly on Collections, Partitions, and Indexes ... Create index for ivf_flat = films.create_index(...) collection films ivf_flat.collection_name ivf_flat.params Index object has states ivf_flat.field_name ... Operate on the Index ivf_flat.drop() object all_partitions = films.partitions() More states on adventure = films.partition(“adventure”) Collection object ivf_flat = films.index()
22 .ORM —— More in one ORM-style API Documentations Roadmaps 1. Auto-generated from API doc-strings
23 .ORM —— More in one ORM-style API Documentations Roadmaps 2. Written by contributors
24 .ORM —— More in one ORM-style API Documentations Roadmaps All documentations avaliable at API Reference section https://milvus.io/docs/home Doc sources avaliable at https://github.com/milvus-io/pymilvus/tree/master/docs
25 .ORM —— More in one ORM-style API Documentations Roadmaps PyMilvus as a DBS SDK PyMilvus as a library: PyMilvus as a cloud service SDK local-index and ANNS Merge of PyMilvus and PyMilvus-ORM repo MEP 3 Merge PyMilvus and PyMilvus-ORM repository On July 20th, 2021 Milvus 1st tech meeting
26 .All Contributors
27 .Thank You https://milvus.io https://github.com/milvus-io/milvus 扫码加入直播交流群 关注 Milvus 视频号 https://github.com/milvus-io/pymilvus 与讲师实时QA 直播视频早知道 https://twitter.com/milvusio