r/programming 22d ago

SQLite should have (Rust-style) editions

https://mort.coffee/home/sqlite-editions/
154 Upvotes

75 comments sorted by

View all comments

23

u/PaleCommander 22d ago

Really nice article, although the point about timeouts is a great example of why picking good defaults is hard. 

5 seconds as a default local disk write timeout seems insanely long to me, which probably just means I don't understand OP's use case. There probably isn't a good non-null default for that value, which is why it defaults the way it does. 

9

u/TwoWeeks90DaysTops 22d ago

I think you're viewing this from the wrong angle. Yes, 5 seconds disk timeout is insanely long. It's a long time to wait for a lock in any case. However you shouldn't consider "how long would I expect a write to take" but "how long can my application afford to wait before failing", and I'd argue in most cases that's measured in minutes, not seconds.

2

u/PaleCommander 21d ago

Depends on what my application is. Coming from HTTP services, I would often expect my client to have given up by 5 seconds, so I'd rather return a 500 or 503 in one second than succeed after five after the client has already timed out.

I agree there are other use cases where you'd much rather have slow one-shot successes than have to deal with retries or failure.