• 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

SQLite Integration

Scheduled Pinned Locked Moved Feature Requests
12 Posts 6 Posters 593 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.
  • chuyuaC Offline
    chuyuaC Offline
    chuyua
    wrote on last edited by
    #1

    Re: SQLite Integration

    hello sir , i need sqlite support very much this can make my running cost lower

    1 Reply Last reply
    0
  • stevefan1999-personalS Offline
    stevefan1999-personalS Offline
    stevefan1999-personal
    wrote on last edited by
    #2

    I have a database plugin for sale, powered by TypeORM.

    I have also made sure it could work with most of the database out of the box that supports multiple database backend, including MySQL, Postgres, SQLite, SQL Server and of course SQLite. But to install it there might be some patches needed. I'm still coming up with some idea of how to run the integration test in NodeBB main DB test suites. Once I got 100% conformance on all supported databases mentioned, this will be on https://privjs.com/ soon.

    julianJ 1 Reply Last reply
    1
  • julianJ Offline
    julianJ Offline
    julian GNU/Linux
    replied to stevefan1999-personal on last edited by
    #3

    @stevefan1999-personal That's very very cool 🙂 I'm sure there are many out there who would want to have NodeBB run on MySQL 😄

    gotwfG 1 Reply Last reply
    1
  • gotwfG Offline
    gotwfG Offline
    gotwf Community Rep
    replied to julian on last edited by gotwf
    #4

    @julian said in SQLite Integration:

    @stevefan1999-personal That's very very cool I'm sure there are many out there who would want to have NodeBB run on MySQL

    Uh, surely you mean MariaDB? Or maybe Percona? 😜

    Call me a rebel if you will but I eschew products that sold out to the dark side. Especially anything Larry has his hands in. 🗡

    Side Bar: For those into MySQL'esque rdbms, Percona XtraDB Cluster is pretty sweet. 👍

    julianJ 1 Reply Last reply
    0
  • julianJ Offline
    julianJ Offline
    julian GNU/Linux
    replied to gotwf on last edited by
    #5

    @gotwf Yeah MariaDB. Whenever I need MySQL, I end up using that drop-in replacement 🙂

    gotwfG 1 Reply Last reply
    1
  • gotwfG Offline
    gotwfG Offline
    gotwf Community Rep
    replied to julian on last edited by
    #6

    @julian Heh, yes, I guess the term "MySQL" has become generic in same sense as "Kleenex". 😜

    1 Reply Last reply
    0
  • C Offline
    C Offline
    chung-leong
    wrote on last edited by
    #7

    I've just finished writing code that enables the use of SQlite3 with NodeBB. It passes the test suite and seems to work pretty well. Made the necessary change to nodebb-plugin-dbsearch too. Will a pull request be considered or is SQLite support too obscure?

    1 Reply Last reply
    0
  • julianJ Offline
    julianJ Offline
    julian GNU/Linux
    wrote on last edited by
    #8

    @chung-leong not obscure at all, we'd be happy to take a look 😄

    phenomlabP 1 Reply Last reply
    0
  • phenomlabP Offline
    phenomlabP Offline
    phenomlab
    replied to julian on last edited by
    #9

    @julian Would MySQL support be available ?

    1 Reply Last reply
    0
  • julianJ Offline
    julianJ Offline
    julian GNU/Linux
    wrote on last edited by
    #10

    Well, SQlite and MySQL are similar in many ways... so theoretically, yes.

    The problem isn't whether it is possible but whether the implementation is performant. We've built NodeBB around the concept of NoSQL data structures, specifically, those found in Redis (e.g. hashes, sorted sets, and to a much lesser degree, simple sets).

    SQL can mimic these structures, yes. However the power of a relational database is that the schema is defined beforehand, and indexed for speed. NoSQL kind of threw that out the window, and if someone came up to us and asked us for a database schema, we'd just throw up our hands and 🤷

    So whatever SQL implementation is added, it needs to take into account our need to be able to create sorted sets on-the-fly.

    What that looks like in reality (and what the pgsql driver does)... is use god tables; one giant table for every sorted set in NodeBB. That is technically an anti-pattern, but it does work.

    1 Reply Last reply
    1
  • C Offline
    C Offline
    chung-leong
    wrote on last edited by
    #11

    Okay, I'll send a pull request.

    Adding MySQL support would be pretty tricky, I think. To emulate certain operations on sorted sets, I ended up just pulling the fully data set and processing it in JavaScript. Since SQLite is in-process, that's not a huge issue. You can't really do the same with a real RDBMS. The expectation level is different too. If you're choosing SQLite as a storage mechanism, you know you're sacrificing scalability for the sake of a reduction in hardware requirement.

    julianJ 1 Reply Last reply
    2
  • julianJ Offline
    julianJ Offline
    julian GNU/Linux
    replied to chung-leong on last edited by
    #12

    @chung-leong said in SQLite Integration:

    To emulate certain operations on sorted sets, I ended up just pulling the fully data set and processing it in JavaScript.

    Yes, this is what I was afraid of... there are certain concessions that need to be made for an SQL driver when you build your software around the expectation of a schema-less data store 😆

    Nevertheless, I am looking forward to reviewing.

    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