Best practices

Some best practices for using Doctrine with MongoDB are as follows:

  • Don't use unnecessary cascading. It impacts performance.
  • Don't use unnecessary life cycle events. It impacts performance.
  • Don't use special characters such as non-ASCII ones in class, field, table, or column names as Doctrine is not Unicode-safe yet.
  • Initialize collection references in the model's constructor.
  • Constrain relationships between objects as much as possible. Avoid bidirectional associations between models and eliminate the ones that are not needed. This helps with performance, loose coupling, and produces simpler and easily maintainable code.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.170.174