Skip to content

A simple SQL-like database built on top of Key-Value storages

License

Notifications You must be signed in to change notification settings

zalopay-oss/zpd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ZPD

Build Status Coverage Status version version version

Overview

ZPD (or ZaloPay Database) is a probationary challenge performed at ZaloPay. It's an experiment to gain deep knowledge about handling simple SQL queries and how to glue them with a key-value storage.

ZPD is implemented using Golang as a gRPC service and built on top of following frameworks:

  • Consul for leader elections.

  • TiKV as the main key-value storage

Architecture

The architecture of the ZPD:

Including layers:

  • Connection layer
  • Parser layer
  • Core layer:
    • Executor
    • Consul Agent
    • Bridge API
  • Data access layer
  • Storage:
    • TiKV client layer

See the architecture of ZPD here.

Requirement

  • Golang version >= 1.12
  • gRPC
  • Docker version >= 17.06 and Docker Compose
  • Locust

Install

Build

Clone this project:

# Clone
$ git clone https://gitlab.zalopay.vn/zpx-core-team/tidb-internals.git

Run

ZPD, PD, TiKV, Consul are all built with Docker compose. Just go to the docker-compose folder and run docker-compose up.

# go to the folder docker-compose
$ cd ./tidb-layer/source/docker-compose

# Run docker-compose
$ docker-compose up

Test

Must run ZPD as the section above, then run tests of the APIs:

# go to cmd/client
$ cd ./tidb-layer/source/cmd/client

# run tests
$ go test -run TestClientExecuteCreateDB 
  • You can write more tests into client_test.go like the available format.

Document

Read more document about ZPD:

Read blogs:

Contribution

This project was built by AJPham and Alex Nguyen under the guidance from Anh Le (Andy).

Acknowledgments

License

See the LICENSE file for license rights and limitations.