invidious icon indicating copy to clipboard operation
invidious copied to clipboard

Running Invidious Without Postgres

Open p0da opened this issue 4 years ago • 11 comments

Would you consider adding the ability to run Invidious without postgres? This would be extremely useful for small single user instances hosted on resource constrained machines.

p0da avatar Jan 17 '21 02:01 p0da

This is definitely something I've been thinking about, for instances without accounts enabled this should be easily do-able. The caching should be done on plain files/ram.

TheFrenchGhosty avatar Jan 17 '21 21:01 TheFrenchGhosty

I'm trying to remove all references to Postgres -- I'll see how far I can go.

DUOLabs333 avatar Oct 10 '21 12:10 DUOLabs333

I'm trying to remove all references to Postgres -- I'll see how far I can go.

Which database are you using instead then?

unixfox avatar Oct 10 '21 13:10 unixfox

@unixfox

I'm trying to remove all references to Postgres -- I'll see how far I can go.

Which database are you using instead then?

I think their idea was to just remove the postgres word from the code... nothing more xD So obviously this won't work.

TheFrenchGhosty avatar Oct 10 '21 22:10 TheFrenchGhosty

@TheFrenchGhosty I wasn't simply going to remove the word "Postgres", I was going to remove any code that depends on a database running. But yeah, I thought that if you disabled accounts and registration, it wouldn't make any calls to Postgres (or not nearly enough), so simply any lines that need Postgres can be removed. However, looking though the code showed me that it would be a bit more complicated than that, as some of the functionality is tightly integrated with Postgres (though if you only use Youtube accounts, not local ones, Redis may be a good idea...)

DUOLabs333 avatar Oct 10 '21 22:10 DUOLabs333

@DUOLabs333 Ah makes sense.

Yeah basically all caching is done through Postgres, so a whole new handling is required to "get rid" of the Postgres requirement.

TheFrenchGhosty avatar Oct 10 '21 22:10 TheFrenchGhosty

Redis could work, no? It would also have the benefit of making it easier to set up?

DUOLabs333 avatar Oct 10 '21 22:10 DUOLabs333

@DUOLabs333

Yeah any DB, Redis or SQLite will work. Invidious just has to have code to use them.

TheFrenchGhosty avatar Oct 10 '21 22:10 TheFrenchGhosty

This is important to me because I would like to run a bunch of 'stateless' Invidious instances

BBaoVanC avatar Jun 23 '22 20:06 BBaoVanC

I managed to patch Invidious to work without the database logic. Its quite hastily put together but if anyone's needing this feature it can be found over at my branch here:

https://github.com/syeopite/invidious/tree/no-database

It is done through a compile time flag so you'd need to build Invidious with the -Dno_postgresql parameter

crystal build src/invidious.cr -Dno_postgresql

syeopite avatar Nov 25 '23 22:11 syeopite