그래프 구조를 무상으로 취급할 수 없는 것은 싫기 때문에, redisgraph를 WSL2에 극치고 설치해 보았습니다.

만우절 날이기 때문에.



제목은 만우절이므로.
그렇다, 역시, 앞으로는 그래프 구조 데이터베이스라고 생각했다. ... 생각한 것은 몇 년 전인가.

전부터 Neo4j는 시험하고 있지만, 영업 분들로부터 상용 라이센스가 높다고 가르쳐 주었으므로, 전전부터 신경이 쓰여 있던 redisgraph를 시험해보기로 했다.
내 실행 환경은 wsl2+ununtu on windows 10에 구축한 docker(부기에 설치기를 적는다).
다만, 이하, docker가 달리고 있으면 무엇이든 좋다. docker조차 움직이면 설치에 필요한 시간은 몇 분.

redisgraph 사이트:
htps : // 오스.ぢ s bs. 코 m/레에 sg 등 ph/

redisgraph는 redis에서 움직이는 공예 구조 데이터베이스입니다. 그래프 구조를 쿼리하는 cypher가 통과합니다. 좋은 점으로는, neo4j보다는 메이저인 redis상에서 움직이는 그래프 구조 데이타베이스라고 하는 곳인가. 비교적 담담하게 유지되고 있다.

redisgraph의 docker를 통한 소개



docker가 달리고 있으면, 공식 사이트에 있는 대로, 이하에서, redisgraph가 동작한다.

docker run -p 6379:6379 -it --rm redislabs/redisgraph

아래와 같이 redis 움직이고 있습니다 어필이 주면, 뒤로 redisgraph도 움직이고 있다.
$ sudo docker run -p 6379:6379 -it --rm redislabs/redisgraph
Unable to find image 'redislabs/redisgraph:latest' locally
latest: Pulling from redislabs/redisgraph
68ced04f60ab: Pull complete
7ecc253967df: Pull complete
765957bf98d4: Pull complete
91fff01e8fef: Pull complete
76feb725b7e3: Pull complete
75797de34ea7: Pull complete
5cba5fea34d7: Pull complete
a7ce59b41c3a: Pull complete
Digest: sha256:f154681547adea4fa4d376e43ee69471d8b4f7d3cd3e2e9a42b26090b19e20fc
Status: Downloaded newer image for redislabs/redisgraph:latest
1:C 01 Apr 2020 08:37:12.414 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 01 Apr 2020 08:37:12.414 # Redis version=5.0.8, bits=64, commit=00000000, modified=0, pid=1, just started
1:C 01 Apr 2020 08:37:12.414 # Configuration loaded
                _._
           _.-``__ ''-._
      _.-``    `.  `_.  ''-._           Redis 5.0.8 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._
 (    '      ,       .-`  | `,    )     Running in standalone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
 |    `-._   `._    /     _.-'    |     PID: 1
  `-._    `-._  `-./  _.-'    _.-'
 |`-._`-._    `-.__.-'    _.-'_.-'|
 |    `-._`-._        _.-'_.-'    |           http://redis.io
  `-._    `-._`-.__.-'_.-'    _.-'
 |`-._`-._    `-.__.-'    _.-'_.-'|
 |    `-._`-._        _.-'_.-'    |
  `-._    `-._`-.__.-'_.-'    _.-'
      `-._    `-.__.-'    _.-'
          `-._        _.-'
              `-.__.-'

redisgraph의 동작 확인



redis-client를 사용한다.
우분투에 설치 :
 sudo apt install redis-tools

cypher의 쿼리는 만우절이므로, 이런 식으로 해 두자.

GRAPH.QUERY Itai "CREATE (:Rider {name:'maple 메이플'})-[:rides]->(:Mover {name:'SH 시럽'}), (:Rider {name:'surry 샐리'}) -[:rides]->(:Mover {name:'SH 시럽'}), (:Rider {name:'kuroko 쿠로코'})-[:rides]->(:Mover {name:'SHUG 샤르게'}} )"
GRAPH.QUERY Itai "MATCH (r:Rider)-[:rides]->(t:Mover) WHERE t.name = 'SH시럽' RETURN r.name, t.name"

실행 결과
$ redis-cli
127.0.0.1:6379> GRAPH.QUERY Itai "CREATE (:Rider {name:'mapleメイプル'})-[:rides]->(:Mover {name:'SHシロップ'}), (:Rider {name:'surryサリー'})-[:rides]->(:Mover {name:'SHシロップ'}), (:Rider {name:'kuroko黒子'})-[:rides]->(:Mover {name:'SHUGシュガミ'})"
1) 1) "Nodes created: 6"
   2) "Properties set: 6"
   3) "Relationships created: 3"
   4) "Query internal execution time: 3.183400 milliseconds"
127.0.0.1:6379> GRAPH.QUERY Itai "MATCH (r:Rider)-[:rides]->(t:Mover) WHERE t.name = 'SHシロップ' RETURN r.name, t.name"
1) 1) "r.name"
   2) "t.name"
2) 1) 1) "maple\xe3\x83\xa1\xe3\x82\xa4\xe3\x83\x97\xe3\x83\xab"
      2) "SH\xe3\x82\xb7\xe3\x83\xad\xe3\x83\x83\xe3\x83\x97"
   2) 1) "maple\xe3\x83\xa1\xe3\x82\xa4\xe3\x83\x97\xe3\x83\xab"
      2) "SH\xe3\x82\xb7\xe3\x83\xad\xe3\x83\x83\xe3\x83\x97"
   3) 1) "surry\xe3\x82\xb5\xe3\x83\xaa\xe3\x83\xbc"
      2) "SH\xe3\x82\xb7\xe3\x83\xad\xe3\x83\x83\xe3\x83\x97"
3) 1) "Query internal execution time: 1.590000 milliseconds"

... wsl2에서 일본어는 cli로 표시되지 않는 것 같습니다. .

부기 wsl2에 docker 설치



대체로, 이하의 소개해 주시고 있는 대로.
htps // 유키츠나. 코 m/2201/

계속.



이어지는 ... 는, 본가 '아픈 것은 싫어' 쪽인가. 또 탈력시켜 주는 것을 기대.
redisgaph의 사용법편이나 서버측에서 움직여 보는 편은, 한동안. 그래서 모두가 만우절의 날에는 어드벤트 캘린더와 다른 기합이없는 기사를 쓰자고 말해 보거나

htps : // 나타에. 무/코미 c/네 ws/373162

좋은 웹페이지 즐겨찾기