当前位置:网站首页>The sea of stars hidden behind the nebula graph
The sea of stars hidden behind the nebula graph
2022-07-02 15:48:00 【Figure database nebulagraph】
This article was first published in Nebula Graph Community official account
The authors introduce
Hello everyone , I am a Anyzm,graph-ocean(GitHub:https://github.com/nebula-contrib/graph-ocean) Project sponsor , Currently working in 360 Number division , Position is senior JAVA Development Engineer .
After introducing myself , Let's introduce graph-ocean What is it? ?
graph-ocean brief introduction
graph-ocean It's based on nebula-java Client's ORM(Object Relational Mapping) frame , be familiar with ORM We should all know ORM Is to create something that can be used in a programming language “ Virtual object database ”, Let developers develop business more efficiently .
And I will Java ORM named graph-ocean Derived from Ocean And Nebula Graph Of Nebula( Stars ) Echo each other , It means the sea of stars .
Why design a Java ORM
If community users are right 360 If you are familiar with mathematics , Read what our technical team wrote 《JanusGraph To NebulaGraph transfer 》( link :https://discuss.nebula-graph.com.cn/t/topic/1172) Then we know that we are Nebula Graph It was used very early , In the official release v1.0.0 I have been running in the test environment before .
stay 360 It is used by the Department of mathematics Nebula Graph v1.0.0 In the process , We Java The client uses enumerations to present Tag and Edge data , And will be API It can be interpreted as nGQL Also strongly depends on enumeration , Highly intrusive to business code .
therefore , I was determined to change this situation in the process of contacting the project later .
Solve the problem of code intrusion
We all know that no matter what framework is connected to the database , The framework will eventually be parsed into a language recognized by the database . about Nebula Graph for , Users can use openCypher, You can also use Nebula Graph Native query language nGQL.
We are used to using... In our projects nGQL, So parse the business code into nGQL This step uses v1.0.0 A large part of the process has been completed . The intrusive nature of business code is due to the enumeration of vertices and edges , Enumeration is used to locate Tag perhaps Edge, You want to get this information from the entity class without intrusion , I thought of imitating JPA(Java Persistence API) How to annotate .
therefore ,graph-ocean In my mind, I have a preliminary image , Once the entity class is determined , Corresponding Tag perhaps Edge It should also be certain , So you can use caching to improve performance .
( Overall design drawings )
After simple design ,graph-ocean It was born . After development , My colleagues and I feel very comfortable with it , So I decided to open source the framework and feed it back to the community .
graph-ocean characteristic
graph-ocean It can make developers more elegant 、 Be more flexible about Nebula Graph Reading and writing , And it can help us quickly realize the mutual transformation of entity and database data ( This is also ORM Features of the framework ), At the same time, there is a cache , So there is no need to worry about performance .
graph-ocean Simple use
graph-ocean By Java annotation 、 Reflection 、 cache 、 String splicing 、nebula-java Connection pool 、session Management, etc . Users can get started quickly if they have skilled experience in reflection and connection pool development , It doesn't matter if it doesn't , Mainly grasp NebulaSessionPoolManager(session management )、GraphMapper( Basic database operation class )、@GraphEdge( Edge annotation )、@GraphVertex( Vertex annotation )、@GraphProperty( Attribute annotation )、GraphQuery( Inquire about API)、QueryResult( Query results ) Just these classes or interfaces .
graph-ocean The future plan of
graph-ocean Not yet supported Nebula Graph All the built-in functions ( However, it has also met most business scenarios ), because graph-ocean rely on nebula-java, So with nebula-java Version change of ,graph-ocean You also need to maintain the version for a long time .
because graph-ocean At present, it is basically maintained by me , The documentation is not complete , There are still many points that need to be improved .
therefore , The next stage is to gradually improve the use of documents , And perfection API, At the same time, I hope more like-minded people will join in , maintain graph-ocean This sea of stars .
Communication graph database technology ? Join in Nebula Communication group please first Fill in your Nebula Business card ,Nebula The little assistant will pull you into the group ~~
边栏推荐
- 2303. Calculate the total tax payable
- [idea] recommend an idea translation plug-in: translation "suggestions collection"
- [leetcode] 977 square of ordered array
- 目标检测—利用labelimg制作自己的深度学习目标检测数据集
- [experience cloud] how to get the metadata of experience cloud in vscode
- 【Leetcode】167-两数之和II -输入有序数组
- (万字精华知识总结)Shell脚本编程基础知识
- Aike AI frontier promotion (7.2)
- PyObject 转 char* (string)
- 可视化技术在 Nebula Graph 中的应用
猜你喜欢
【LeetCode】1905-统计子岛屿
已知两种遍历序列构造二叉树
隐藏在 Nebula Graph 背后的星辰大海
使用 percona 工具给 MySQL 表加字段中断后该如何操作
树-二叉搜索树
《大学“电路分析基础”课程实验合集.实验七》丨正弦稳态电路的研究
Two traversal sequences are known to construct binary trees
【Salesforce】如何确认你的Salesforce版本?
Finally, I understand the event loop, synchronous / asynchronous, micro task / macro task, and operation mechanism in JS (with test questions attached)
智联招聘的基于 Nebula Graph 的推荐实践分享
随机推荐
/Bin/ld: cannot find -lxml2
《大学“电路分析基础”课程实验合集.实验四》丨线性电路特性的研究
[salesforce] how to confirm your salesforce version?
奥比中光 astra: Could not open “2bc5/[email protected]/6“: Failed to set USB interface
6095. 强密码检验器 II
(万字精华知识总结)Shell脚本编程基础知识
【Salesforce】如何确认你的Salesforce版本?
【LeetCode】977-有序數組的平方
[experience cloud] how to get the metadata of experience cloud in vscode
如何实现十亿级离线 CSV 导入 Nebula Graph
《大学“电路分析基础”课程实验合集.实验七》丨正弦稳态电路的研究
Ant group's large-scale map computing system tugraph passed the national evaluation
/bin/ld: 找不到 -lpam
树-二叉搜索树
Custom exception
2303. 计算应缴税款总额
6090. Minimax games
[leetcode] 877 stone game
How to intercept the value of a key from the JSON string returned by wechat?
【LeetCode】1905-统计子岛屿