当前位置:网站首页>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 ~~
边栏推荐
猜你喜欢
爱可可AI前沿推介(7.2)
(Video + graphic) machine learning introduction series - Chapter 5 machine learning practice
全是精华的模电专题复习资料:基本放大电路知识点
Xpt2046 four wire resistive touch screen
基于 Nebula Graph 构建百亿关系知识图谱实践
[leetcode] 1162 map analysis
如何实现十亿级离线 CSV 导入 Nebula Graph
Why does the system convert the temp environment variable to a short file name?
二叉树前,中,后序遍历
Experiment collection of University "Fundamentals of circuit analysis". Experiment 7 - Research on sinusoidal steady-state circuit
随机推荐
/bin/ld: 找不到 -lxslt
[idea] recommend an idea translation plug-in: translation "suggestions collection"
2279. 装满石头的背包的最大数量
Analysis of the difference between array and linked list
【Experience Cloud】如何在VsCode中取得Experience Cloud的MetaData
使用FFmpeg命令行进行UDP、RTP推流(H264、TS),ffplay接收
蚂蚁集团大规模图计算系统TuGraph通过国家级评测
/Bin/ld: cannot find -lcrypto
【LeetCode】1020-飞地的数量
[leetcode] 877 stone game
Basic knowledge of cryptography
2278. Percentage of letters in string
愛可可AI前沿推介(7.2)
《大学“电路分析基础”课程实验合集.实验六》丨典型信号的观察与测量
[leetcode] 1905 statistics sub Island
【LeetCode】486-预测赢家
【Salesforce】如何确认你的Salesforce版本?
Fiddler实现手机抓包——入门
解决BASE64Encoder报错的问题
The outline dimension function application of small motherboard