• Home
  • Categories
  • Recent
  • Popular
  • Top
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
v3.5.2 Latest
Buy Hosting

PostgreSQL support

Scheduled Pinned Locked Moved Feature Requests
portgresql
9 Posts 4 Posters 3.8k Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    miwilc
    wrote on last edited by miwilc
    #1

    Can we have postgreSQL support in nodebb

    jareyJ 1 Reply Last reply
    2
  • jareyJ Offline
    jareyJ Offline
    jarey Translator
    replied to miwilc on last edited by
    #2

    @miwilc don't think it would be suitable for the nodebb perspective. Actually redis and mongodb are supported, both connectors using the same API that was firstly created with redis in mind, with a key/value approach under 1 collection.

    Sure it can be done using postgresql, but a connector should be made, and it would have to use same approach as the existing ones, and would't make more sense using a relational database.

    PitaJP 1 Reply Last reply
    0
  • PitaJP Offline
    PitaJP Offline
    PitaJ Global Moderator Plugin & Theme Dev
    replied to jarey on last edited by
    #3

    @jarey I think SQL matches pretty closely to what NodeBB has already implemented in terms of database functionality. I'd like to see a PostgreSQL adapter as a replacement for MongoDB since NodeBB really doesn't use many of the document-store features of Mongo.

    jareyJ 1 Reply Last reply
    2
  • lenovouserL Offline
    lenovouserL Offline
    lenovouser
    wrote on last edited by
    #4

    I mean, the whole k/v thing was weird to me from the start. I think writing a wrapper around the database stuff and then in the future maybe being able to do npm i nodebb-database-redis, npm i nodebb-database-mongo, npm i nodebb-database-postgresql, etc. would be awesome. Also because everyone could help writing these wrappers for new databases etc.

    PitaJP 1 Reply Last reply
    0
  • PitaJP Offline
    PitaJP Offline
    PitaJ Global Moderator Plugin & Theme Dev
    replied to lenovouser on last edited by
    #5

    @lenovouser I agree, it would be good to allow the database adapter to be a module.

    I would like to point out that the adapters are already modular, though, and you can add new ones yourself as long as they match the existing adapters.

    1 Reply Last reply
    0
  • jareyJ Offline
    jareyJ Offline
    jarey Translator
    replied to PitaJ on last edited by jarey
    #6

    @PitaJ what i means is that i don't think relational databases are really suitable for the squeme that nowadays provides nodebb. Only one table with string key and blob for values seems a bit awkward in terms of relational database use.

    If you refer of having the actual model implementing an ER approach, i think it would be fantastic too. But don't know how would you achieve a schemaless model implementation under relational databases without storing all info in a blob or something similar. Sure a global schema for the core features would be plaussible since it could be maintained by nodebb team and supported between versions upgrades; but plugin-wise it would be a little more complicated to mantain the model in a flexible way.

    PitaJP 1 Reply Last reply
    0
  • PitaJP Offline
    PitaJP Offline
    PitaJ Global Moderator Plugin & Theme Dev
    replied to jarey on last edited by
    #7

    @jarey a relational database is obviously much more than Redis. However, I think a relational DB like PostgreSQL is much closer to a basic k/v DB than something like MongoDB.

    jareyJ 1 Reply Last reply
    0
  • jareyJ Offline
    jareyJ Offline
    jarey Translator
    replied to PitaJ on last edited by jarey
    #8

    @PitaJ said in PostgreSQL support:

    @jarey a relational database is obviously much more than Redis. However, I think a relational DB like PostgreSQL is much closer to a basic k/v DB than something like MongoDB.

    I don't agree there. MongoDB being schemaless for me is an easy way to work with the javascript objects in json. I think it would be harder to work with traditional relational databases like PostgreSQL in that approach. If you don't see MongoDB suitable, because its collection model is not used by Nodebb, the table model around PostgreSQL wouldn't be used either with the additional problem of being tied to an specific schema if you don't model all data with key/blob.

    Another thing would be talking about using PostgreNoSQL, in that case i suppose it would be nearly-equivalent to redis key/value.

    PitaJP 1 Reply Last reply
    0
  • PitaJP Offline
    PitaJP Offline
    PitaJ Global Moderator Plugin & Theme Dev
    replied to jarey on last edited by PitaJ
    #9

    @jarey

    MongoDB being schemaless for me is an easy way to work with the javascript objects in json. I think it would be harder to work with traditional relational databases like PostgreSQL in that approach.

    I'm not talking about whatever your specific use case is, I'm only talking about how NodeBB/database works.

    If you don't see MongoDB suitable, because its collection model is not used by Nodebb, the table model around PostgreSQL wouldn't be used either with the additional problem of being tied to an specific schema if you don't model all data with key/blob.

    What I'm saying is that the relational table structure (SQL) is closer to key/value (Redis) than the document-store structure (Mongo). Obviously that doesn't matter when talking about NodeBB/database since it doesn't using any of those specific features. It essentially just emulates Redis on top of Mongo, which a Postgre adapter would also do.

    1 Reply Last reply
    0

Copyright © 2023 NodeBB | Contributors
  • Login

  • Don't have an account? Register

  • Login or register to search.
Powered by NodeBB Contributors
  • First post
    Last post
0
  • Home
  • Categories
  • Recent
  • Popular
  • Top
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development