infinispan-demos / infinispan-pokemon

Query over REST demo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Infinispan Pokemon

This demo uses the query and REST capabilities of Infinispan Server to help you battle Pokemons!

Data is ingested as JSON, and internally stored efficiently as Protobuf. Both query and retrieval happens using JSON taking advantage of the mapping between Protobuf and JSON present in Infinispan

Requirements

Running

  • Start Infinispan Server:

    docker run -it --name infinispan-server -p 11222:11222 -e "USER=user" -e "PASS=user" infinispan/server:13.0

  • Prepare data

    python3 prepare-data.py

  • Creating an indexed cache

    curl -u user:user --digest -H "Content-Type: application/json" -d '{"distributed-cache":{"mode":"SYNC","encoding":{"key":{"media-type":"application/x-protostream"},"value":{"media-type":"application/x-protostream"}},"indexing":{"indexed-entities":["Pokemon"]}}}' http://127.0.0.1:11222/rest/v2/caches/pokemon

  • Register the protobuf schema

    curl -u user:user --digest --data-binary @./pokemon.proto http://127.0.0.1:11222/rest/v2/schemas/pokemon.proto

  • Ingest data

    ./ingest-data.sh

Querying

Example queries:

About

Query over REST demo


Languages

Language:Python 77.8%Language:Shell 22.2%