Encapsulation in Distributed Systems

February 2025

Back home

If you like global variables, you're going to love databases!

Encapsulation is regarded as universally good.

And yet we have databases: warehouses of shared mutable state.

Application ServerDatabase

Every professional programmer knows how to hide the internal state of the components they write. Yet the instant a gets involved, it seems our practiced habits depart, and every component that needs to use the database gets unfettered access to a Connection. The challenge is not limited to databases. Filesystems and cloud services often have the same problem. In short, everything outside the program seems doomed to disorganized global access from multiple components.

Back home