News for hackers. Stuff that matters.
Re:Rust – How do I create a global, mutable singleton? (2015) by aphextron on Wednesday July 22, 2020 @10:44AM (#23917560)
It's not a simple yes/no question. For instance, is a database not ultimately a single mutable global state?
Re:Rust – How do I create a global, mutable singleton? (2015) by chousuke on Wednesday July 22, 2020 @11:05AM (#23917794)
Databases are also designed for safe concurrent access with enforceable constraints on data. Would you like your application behaviour to depend on a transient "database" someone made up on the fly? :)

I think the key is that your database stores data that lives outside your application, making it observable outside any particular application instance and allowing you to perform ad-hoc queries to validate consistency and fix problems. If you have such mutable state inside a process, it can be very difficult to debug problems when a series of interactions sends your process into an inconsistent state that is only detected some hours later when (if) it finally crashes.

Re:Rust – How do I create a global, mutable singleton? (2015) by baq on Wednesday July 22, 2020 @10:55AM (#23917699)
A database connection perhaps, but different connections to the same database will see different states of the database depending on the isolation level of the current transaction.