Skip to content

Why TinyORM?

sdrapkin edited this page Jan 5, 2017 · 5 revisions

TinyORM follows the "T-SQL is king" philosophy and provides simple, developer-friendly, transaction-enforcing API.

TinyORM improves on Dapper in the following areas:

  1. Connection-management ceremony & boilerplate
  • Dapper used to require an open connection to do anything. How that connection came to exist was outside of Dapper's scope. Newer versions can open-close a connection if closed, or keep it open if already-open. However, connections still have to be created and disposed, all of which adds boilerplate and developer burden.
  • TinyORM automates and hides all connection management burden, cutting down the code noise.
  1. Transaction awareness & automation
  • Dapper requires manual transaction management. Many developers are not aware of importance of transactions, or do not know how to correctly start and manage transactions even when they want to write transaction-aware code. We have seen plenty of Dapper code that was very fast and very wrong.
  • TinyORM automatically creates and manages ambient transactions, and auto-enlists all participating connections. Even when no transaction scope is created by developers, all operations will execute in independent READ COMMITTED transactions. Transactions can be suppressed, but they are seamlessly enforced by default without any developer effort.
  1. API simplicity, ease-of-use, and ease-of-correct-use
  2. Design & focus
  • Dapper fuses data-mapping with data-fetching. This leads to nontrivial API surface and complexity.
  • TinyORM focuses on untyped dynamic data-fetching which can be consumed directly, or materialized into strongly-typed objects via a 2nd stage – with negligible performance cost!
  1. Solutions to common problems
  • TinyORM provides solutions for:
    • Batched bulk CUD queries.
    • Streaming BLOBs.
    • Auditing (ex. caller identity tracking, callsite tracking).
    • UPDATE statement creation based on change-tracking/snapshots.
    • Clustering on UNIQUEIDENTIFIER (decentralized, disconnected, secure, and fragmentation-free).