Stored procedures or OR mappers?

后端 未结 15 1270
天命终不由人
天命终不由人 2021-01-06 16:04

Which is better? Or use and OR mapper with SP\'s? If you have a system with SP\'s already, is an OR mapper worth it?

15条回答
  •  北荒
    北荒 (楼主)
    2021-01-06 17:06

    Definitely ORMs. More flexible, more portable (generally they tend to have portability built in). In case of slowness you may want to use caching or hand-tuned SQL in hot spots.

    Generally stored procedures have several problems with maintainability.

    • separate from application (so many changes have now to be made in two places)
    • generally harder to change
    • harder to put under version control
    • harder to make sure they're updated (deployment issues)
    • portability (already mentioned)

提交回复
热议问题