Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature-request: postgres storage support #10

Open
c-nv-s opened this issue Sep 14, 2022 · 9 comments
Open

feature-request: postgres storage support #10

c-nv-s opened this issue Sep 14, 2022 · 9 comments
Labels
enhancement New feature or request

Comments

@c-nv-s
Copy link

c-nv-s commented Sep 14, 2022

please add postgres support to the storage engine options

@peakji
Copy link
Member

peakji commented Sep 14, 2022

We are currently implementing a in-memory storage and will work on adding relational database support when it is stable.

@peakji peakji added the enhancement New feature or request label Sep 18, 2022
@peakji
Copy link
Member

peakji commented Sep 21, 2022

Update: the in-memory store is available in v0.3.0, and now we have a roadmap for adding more storage engines.

@zeina1i
Copy link

zeina1i commented Oct 16, 2022

Hi @peakji
Are you going to define tasks for the roadmap items, and if we are interested,could we be involved?
Thanks

@peakji
Copy link
Member

peakji commented Oct 17, 2022

@zeina1i The roadmap is just a rough plan, and contributions of any kind are always welcome!

In fact, I don't have much experience with Postgres, so I haven't started working on the relevant parts yet. If you are interested in implementing support for a new storage engine, you can refer to the engine package. And if the test cases in testsuite all pass, then it should work properly.

@c-nv-s
Copy link
Author

c-nv-s commented Jan 7, 2023

@zeina1i did you decide to have a look?

@zeina1i
Copy link

zeina1i commented Jan 7, 2023

@c-nv-s unfortunately currently I don't have enough time to be involved.

@c-nv-s
Copy link
Author

c-nv-s commented Feb 25, 2023

not sure why I didn't think of this earlier, but I'll see if I can test this with https://github.com/FerretDB/FerretDB sometime next week.
Hopefully it will serve as a stop-gap until the final implementation.

@c-nv-s
Copy link
Author

c-nv-s commented Mar 22, 2023

just to update on this...
unfortunately not all features worked because it looks like the ferretdb team haven't yet implemented how to handle the hint query functionality from mongodb yet
here is the docker-compose.yml file I used:

services:
  postgres:
    image: postgres
    environment:
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=password
      - POSTGRES_DB=ferretdb
    volumes:
      - ./data:/var/lib/postgresql/data

  ferretdb:
    image: ghcr.io/ferretdb/ferretdb
    ports:
      - 27017:27017
    environment:
      - FERRETDB_POSTGRESQL_URL=postgres://postgres:password@postgres:5432/ferretdb

  ratus:
    image: hyperonym/ratus:0.6.2
    restart: unless-stopped
    depends_on:
      - ferretdb
    environment:
      ENGINE: "mongodb"
      MONGODB_URI: "mongodb://ferretdb:27017"
      MONGODB_DATABASE: "ferretdb"
      MONGODB_COLLECTION: "tasks"
      MONGODB_RETENTION_PERIOD: "72h"
    ports:
      - "8000:80"

networks:
  default:
    name: ferretdb

and you have to remember to add the ferretdb database to your search_path when in psql
I did this using: ALTER ROLE postgres SET search_path = "$user", public, ferretdb ;

@c-nv-s
Copy link
Author

c-nv-s commented Apr 18, 2024

still hoping this feature can be progressed...
the intended workaround using ferretdb seems dependent on them developing the TimeToLive functionality but that ticket seems low priority at the moment, so integrating the feature directly in ratus still seems like the best approach at the moment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants