Skip to content

Zirconium: A high performance server and client using gRPC and MongoDB

License

Notifications You must be signed in to change notification settings

satyajitghana/ProjektZirconium

Repository files navigation

Zirconium Bank 🤑

A high performance Server and Client using gRPC and MongoDB

Status ⌚

zrb-build

language-count top-language repo-size loc-count license maintainer

Tech Stack 🧠

  • languages used
    • c++ 17
    • skylark
    • protobuf
  • libraries
    • mongo-c-driver 1.17.0 beta
    • mongo-cxx-driver 3.5.0
    • gsoncxx
    • cxxopts
    • loguru
  • build tools
    • bazel 3.0.0
    • cmake 3.17.1
  • database
    • mongodb 4.2

Toolchains Required 🎈

  1. Install Bazel
sudo apt install curl
curl https://bazel.build/bazel-release.pub.gpg | sudo apt-key add -
echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list
sudo apt update && sudo apt install bazel
  1. Install CMake
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | sudo apt-key add -
sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main'
sudo apt update
sudo apt install cmake -y

Build Instructions 🔨

  1. Install the dependencies 🍰

INFO: installs mongo-c-driver, mongo-cxx-driver and mongodb

sudo sh install_dependencies.sh
  1. Test your installation 🧪
$ g++ --std=c++11 test.cpp $(pkg-config --cflags --libs libmongocxx) -Wl,-rpath,/usr/local/lib
$ ./a.out
  1. Build 🚀
sudo sh build.sh

Running 🎯

  1. create a replica set in mongo
$ mongod --dbpath /data/db --replSet "rs0"
  1. open a mongo shell and initiate the replica set
rs.initiate()
  1. start the server
$ bazel run //server:zirconium_server --       
  1. start the client
$ bazel run //:zirconium_client -- --username=meow --pin=123456 --deposit=10

Testing

  1. Run Mongod
$ mongod --dbpath /data/db --replSet "rs0"
  1. Run Mongo Client
$ mongo
  1. Create a replica set
rs.initiate()
  1. Open Mongo Compass and connect to our database

Use this URI

mongodb://localhost:27017/?replicaSet=rs0&readPreference=primary&appname=MongoDB%20Compass&ssl=false
  1. Load the data from test_data.json

ADD DATA -> Import File

  1. Start the server
$ ./bazel-bin/server/zirconium_server --config server/server.config
  1. Now run test_transactions.sh

Make sure to install parallel by sudo apt install parallel

$ seq 10 | parallel -j 10 --workdir $PWD ./test/test_transactions.sh {}

Made with 💘 by shadowleaf

About

Zirconium: A high performance server and client using gRPC and MongoDB

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published