Cris
Cris

Reputation: 12194

ORM and performance issues

I'm thinking about learning ORM stuff but I think about one thing. If I have a table (or some joined tables) with millions of records, is it good to have mapped objects with millions of items? Is it safe to handle so big objects?

Thanks!

Upvotes: 1

Views: 332

Answers (3)

Mladen Adamovic
Mladen Adamovic

Reputation: 3201

Trying to map m:n and n:1 relationship indeed car create performance issues.

That's why fjorm do not try to cache them ever. In fjorm, if you want to cache a table in memory, you explicitly annotate it with @FullCache.

Disclaimer: I'm an author of fjorm.

Upvotes: 1

maerics
maerics

Reputation: 156444

It really depends on what you will be doing with these objects; having a large number of them isn't by itself a reason to use ORM or not.

It might be more important to handle records in an object-oriented fashion so that business logic can be reliably performed on them. Or conversely, if performance is a bigger issue then keeping things lighter might be preferable. ORM is just a tool with its pros and cons; you need to decide if the benefits of using that tool outweigh the disadvantages.

Upvotes: 1

Timo Westkämper
Timo Westkämper

Reputation: 22190

is it good to have mapped objects with millions of items ???

No, it's better to keep such relations unidirectional unless you have enough memory to hold all the rows in your RAM.

Upvotes: 1

Related Questions