Ruby Object Mapper (ROM) is a fast Ruby persistence library designed to provide powerful object mapping capabilities without limiting the features of the underlying datastore. Unlike traditional ORMs that focus on object state tracking and identity management, ROM focuses on data and transformations. It aims to isolate the application from persistence details and provide a minimum infrastructure for mapping data into formats needed by the application domain (such as plain Ruby hashes, ROM Structs, or custom objects).
Key design principles include:
- Explicitness: Prefers explicit configuration over "magic".
- Immutability: There is no dirty tracking or mutable state; data is loaded and mapped as a result of direct requests.
- Decoupling: Components are stand-alone, loosely coupled, and follow the single responsibility principle.
- Performance: Prioritizes speed and the use of native datastore features.