worldveil / dejavu

Audio fingerprinting and recognition in Python
MIT License
6.36k stars 1.43k forks source link

feat: add MongoDB support #248

Open ATheCoder opened 3 years ago

ATheCoder commented 3 years ago

This will add MongoDB support.

You can test this by changing the following files:

dejavu.cnf.SAMPLE

{
    "database": {
        "database": "dejavu"
    },
    "database_type": "mongodb"
}

docker-compose.yaml

version: '3'
services:
  db:
    build:
      context: ./docker/postgres
    environment:
      - POSTGRES_DB=dejavu
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=password
    networks:
      - db_network
  mongodb:
    image: mongo
    ports:
        - "27020:27017"
    networks:
      - db_network
  python:
    build:
      context: ./docker/python
    volumes:
      - .:/code
    depends_on:
      - db
    networks:
      - db_network
networks:
  db_network:

Then you can run docker-compose up -d

and then run docker-compose run python /bin/bash

You'll also need to make something like example_docker_postgres.py to start the fingerprinting process and populate the database.

Then you can use python dejavu.py -r file ... to recognize a file.

ATheCoder commented 3 years ago

@worldveil please check this out.

steveouma commented 3 years ago

Hi @ATheCoder, what does the performance look like on MongoDB compared to either Postgre or Mysql?

heechuls commented 2 years ago

Hi @ATheCoder, what does the performance look like on MongoDB compared to either Postgre or Mysql?

+1, Has anyone tested the performance?