Advice: Sqlite or Postgres

Hello, just wondering what people think.

I’m working an app, built with Ruby on Rails. I decided to give the litestack gem a try, which leverages sqlite for general app data storage, background work, caching, search and so on. I briefly enabled LiteFS to make the app more scalable.

It worked out great, but I wound up having to remove LiteFS because it didn’t play well with ActionCable’s use of WebSockets. A typical use of WebSockets in Rails is the server pushing a message out to subscribers that triggers the browser to refresh a portion of a document. I tried various proxy configurations to work around this, with no luck. Has anyone been able to work through this?

Where I’m at now is using a single machine with sqlite, and using litestream to keep an up to date backup. Though the downside with this is, as far as I can tell, is being limited to a single machine since it’s not possible to synchronize data between volumes. Am I overlooking something?

Of course, I could change my approach and just use postgres!

Anyway, just wondering if anyone else been down this road, and what their conclusions and solutions were.

I’ve still had no luck figuring out how to get an internal proxy to work, but it’s occurred to me that running a standalone ActionCable server on another machine could be a simple workaround the LiteFS/WebSocket limitation.

The web app can be be configured to use the new ActionCable host, and the server can be configured to allow the requests from the web app. The actionCable server doesn’t need any redundancy or data persistence, so I would think this will allow the web app deployment to use LiteFS as all websocket communication would not involve the web app machine at all.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.