Giter VIP home page Giter VIP logo

w4n-advanced-databases's Introduction

Advanced Databases Project

Installation

First, you need to create a .env file with your credentials like :

POSTGRES_DB=postgres
POSTGRES_USER=postgres
POSTGRES_PASSWORD=root

[email protected]
PGADMIN_DEFAULT_PASSWORD=root

Then, you need docker and you can run :

docker compose up --build

Containers

There is multiple containers :

  • db : PostgreSQL database - database is located under constant IPv4: 172.18.0.3
  • pgadmin : Manage PostgreSQL database, run on http://localhost:8888
  • api : API written in python, run on http://localhost:5000.

If tables are not generated, you can copy paste the SQL script in sql/init.sql and run it inside pgAdmin to generate all the tables once.

API

  • Count the number of rows in the tables :
curl --request GET \
  --url http://localhost:5000/count \
  --header 'User-Agent: insomnia/8.3.0'
  • Delete all database data :
curl --request DELETE \
  --url http://localhost:5000/delete \
  --header 'User-Agent: insomnia/8.3.0'
  • Task 3 (Fill database with fake data) :
curl --request PUT \
  --url http://localhost:5000/task3 \
  --header 'Content-Type: application/json' \
  --header 'User-Agent: insomnia/8.3.0' \
  --data '{ "NB_USERS": 100000, "NB_COMMENTS": 150000, "NB_POSTS": 200000, "NB_CUSTOMERS": 30000, "NB_SELLERS": 8000, "NB_EMPLOYEES": 1000, "NB_MODERATORS": 550, "NB_MANAGERS": 50, "NB_HUMAN_RESOURCES": 100, "NB_SALES_MODERATORS": 300 }'
  • Task 4 (Monitor queries) :
curl --request PUT \
  --url http://localhost:5000/task4 \
  --header 'User-Agent: insomnia/8.3.0'
  • Task 6 (Monitor queries with indexes) :
curl --request GET \
  --url http://localhost:5000/task5 \
  --header 'User-Agent: insomnia/8.3.0'

w4n-advanced-databases's People

Contributors

ley0x avatar ne-fii avatar

Watchers

 avatar

Forkers

ne-fii

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.