It really depends on your project requirements and your development process. ORMs are packed with a lot of whistles and bring a lot of joy to the table, but if you just buy several individual functions, you may find that the required mental / physical chest is disappointing.
First of all, you should know that there are two types of ORM: those that map an existing scheme to the application logic (you control the scheme) and those that map the application logic to the scheme (ORM controls the scheme). You are better off avoiding the first kind, since they do not make it easier for you to execute / repeat the significant DBA work for each environment, that is, you must make sure that all developers work with the appropriate scheme, in addition to that, the corresponding code is also executed. The second type can completely abstract the fact of your use of the base database, so they allow you to focus on the application domain exclusively, which makes them happy.
No DBA, no local development efforts against an unmanaged remote database instance, no more nuances between RDBMSs, no more stored procedures, more hard-coded link queries, more complex SQL migration queries.
So, ideally, your ORM should:
- Automatic DB schema management for you
- Provide on-site implementation of the Active Record Act
- Indeed, you can encapsulate all business logic
Other good sugars:
- Automatic management of data migrations (if you expect changes in ontologies to be different from changes)
- Support for creating / importing fixtures
Keep in mind that you can run any project with ORM, like @Noon, but you cannot run every project without it at the moment. Ideally, ORMs are fantastic for projects where you want developers to be in full control or you need to run private local database instances. In any case, this is a huge leap from the approach retroactively: make a request to DBA, drink coffee until the database is updated, I hope that this happens within a week.
Filip dupanović
source share