Giter Site home page Giter Site logo

dbih's Introduction

Introduction

This database is designed for high load situations and has a main architecture of Redis and PostgreSQL. Due to the need to generate a large number of personal lists at once, the personal list in PostgreSQL is designed using the List data structure. We first check if the head of the ID -> ListKey exists in Redis. If there is such a list, we update the ID -> ListKey in Redis. When a user visits our database, we output ten pieces of data to them in a lazy tag-like manner, which ensures the throughput performance of the database under heavy traffic.

Endpoints

/modify/{uid}

This endpoint allows users to input data into the database. The request should be sent as a POST request with the following parameters:

  • {uid}: the unique identifier for the user
  • {content}: an array of data to be inputted into the database

Example request:

POST /modify/12345
{
    "content": ["data1", "data2"]
}

/get/{uid}/{page}

This endpoint allows users to retrieve data from the database. The request should be sent as a GET request with the following parameters:

  • {uid}: the unique identifier for the user
  • {page}: the page number of the data to be retrieved

Example request:

GET /get/12345/2

Port

The port number for this database is 8006. Please make changes to main.go accordingly.

Deployment

Please refer to the docker-compose.yml file for deployment information. To start the program, run docker-compose up followed by go run main.go. To stop the program, use kill -9 PID.

dbih's People

Contributors

dengroger avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.