12

Log a warning when running SQLite in production by intrip · Pull Request #42191...

 2 years ago
source link: https://github.com/rails/rails/pull/42191
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Conversation

Copy link

Contributor

intrip commented on May 10

edited

Summary

Log a warning message when running SQlite in production.
The warning can be disabled by setting config.active_record.sqlite3_production_warning=false.

Closes #34715

intrip

changed the title WIP Log a warning when running SQLite in production

Log a warning when running SQLite in production

on May 10

intrip

force-pushed the

intrip:34715-log-warning-sqlite-production

branch from f38be41 to ae168c1

on May 10

intrip

force-pushed the

intrip:34715-log-warning-sqlite-production

branch from 49b3059 to ad6a62e

on May 11

Copy link

Contributor

Author

intrip commented on May 11

@eileencodes thanks for the review! I've applied the suggestion and added the CL entry

eileencodes

merged commit 7fcddd1 into rails:main on May 11

4 checks passed

intrip

deleted the

intrip:34715-log-warning-sqlite-production

branch

on May 11

I find this change a bit strange. SQLite is a good production-like database. Shouldn't this change be about reporting mismatch between dev and production environment rather than suggesting that SQLite is not a good database?

Copy link

Contributor

Author

intrip commented 26 days ago

You can find all the conversations + the reasons of this change in #34715

I reread it and I am very disappointed. Seriously folks! The argument is that SQLite doesn't scale beyond a certain point? As long as it's a supported database in Rails, this change should be reverted.

Copy link

Member

zzak commented 26 days ago

@strzibny That's fair, and there is nothing stopping you from using SQLite in production. This warning is intended to notify people who might not be as comfortable managing that database in a production environment, if you're comfortable choosing that database as your preferred solution more power to you.

Copy link

strzibny commented 26 days ago

edited

@zzak The problem is that you got it backward I think.

Managing SQLite is super simple whereas making a production-grade MySQL/PostgreSQL deployment is much more daunting. A lot of beginners have trouble making even a development environment work -- I know, because in my early days I used some Mac OS app to do it for me, and it was something I didn't understand.

Nobody should be forced to suddenly stop - and go learn about production-grade PostgreSQL deployment only to finish the deployment of their simple projects on a virtual server. They could just carry on with SQLite. It's a great first step. I and you understand that the warning is in fact wrong, but those starting would take it as a serious recommendation.

I always liked that Rails supported SQLite so that beginners (but also professionals) can make a simple app/showcase and also put it into production with very little effort. I compare it with Phoenix where we still don't have a good SQLite story and it's in fact a bit annoying. Deploying databases is not an easy feat! It requires some studying to do it right. But for SQLite? No issue. Can you manage a file? Then you can manage SQLite.

I am trying to recheck the guides https://guides.rubyonrails.org/getting_started.html#creating-a-new-rails-project-installing-rails and there is nothing about SQLite not being supported for production.

I think this is about expectations. Is SQLite supported as a production database in Rails? If yes, there cannot be a warning about using it in production. If not, I would expect we change the docs to mention it.

Users (especially beginners) shouldn't find out the database they chose is not supported once they actually go and deploy. That's very unergnomic.

Copy link

Member

eileencodes commented 26 days ago

@strzibny I appreciate your perspective and concern, but the core team discussed this on the issue and came to a consensus to add this logged warning. It doesn't prevent you from using sqlite. We don't have plans to revert this at the moment.

Okay. It's unfortunate, but it's up to you.

@eileencodes can you please confirm or deny whether SQLite is still supported for production use in Rails? The guides mention SQLite all the time, but it's actually not clear to me if this is supported now or not.

Copy link

Member

eileencodes commented 26 days ago

edited

@strzibny it's a single warning issued on boot in the production env. Nothing is preventing you from using SQLIite in any environment. It is still supported the same as it was before, just with a little warning in your logs.

All the reasoning for adding this was explained in the issue. You're free to dislike it and you're free to keep using sqlite. However, please stop arguing with us about this. We are not reverting this change and I will lock this PR if you keep arguing with us because it's not productive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Linked issues

Successfully merging this pull request may close these issues.

5 participants

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK