background preloader

Object-relational mapping

Object-relational mapping
Not to be confused with Object-Role Modeling. Object-relational mapping (ORM, O/RM, and O/R mapping) in computer software is a programming technique for converting data between incompatible type systems in object-oriented programming languages. This creates, in effect, a "virtual object database" that can be used from within the programming language. There are both free and commercial packages available that perform object-relational mapping, although some programmers opt to create their own ORM tools. Overview[edit] Comparison with traditional data access techniques[edit] Compared to traditional techniques of exchange between an object-oriented language and a relational database, ORM often reduces the amount of code that needs to be written.[2] Disadvantages of O/R mapping tools generally stem from the high level of abstraction obscuring what is actually happening in the implementation code. NoSQL (Not Only SQL) databases[edit] Challenges[edit] See also[edit] References[edit]

Playing with dapper Micro ORM and ASP.NET MVC 3.0 - DotNetJalps Some time ago Sam Saffron a lead developer from stackoverflow.com has made dapper micro ORM open source. This micro orm is specially developed for stackovewflow.com for keeping performance in mind. It’s very good single file which contains some cool functions which you can directly use in your browser. So I have decided to have a look into it. You can download dapper code from the following location it’s a single static class file called SQLMapper. So once you download that file you can use that file into your project. Now let’s first create sample table from which we will fetch the data with the help of dapper file. CREATE TABLE [dbo]. Once I have created table I have populated some test data like following. Now we are ready with database table Now its time to add a customer entity class. Now we are ready with our model classes now It’s time to Create a Controller so I have created a Customer Controller like following. That’s it.

How I learned to stop worrying and write my own ORM UPDATE Dapper is now open source A few weeks ago we started investigating some performance issues at Stack Overflow. Our web tier was running hot, it was often hitting 100% CPU. This was caused by a combination of factors, we made a few mistakes here and there. We allowed a few expensive operation to happen a bit too concurrently and ... there were some framework issues. Google's monster spider machine Google loves Stack Overflow, it loves it so much that it will crawl 10 pages a second sometimes. The trouble was that crawling our question pages was expensive business. We maintain a list of related questions on every question page, this list is rebuilt once a month in a on demand background process. So, we fixed that up. In frameworks we trust Our question show page does a fair bit of database work. Much of our work at Stack Overflow depended on the assumption that LINQ-2-SQL is fast enough. Build your own ORM 101 There are tons of Object-Relational-Mappers for the .Net framework. My solution

robconery/massive Topten Software A tiny ORM-ish thing for your POCOs PetaPoco is a tiny, fast, single-file micro-ORM for .NET and Mono. Like Massive it's a single file that you easily add to any projectUnlike Massive it works with strongly typed POCO'sLike Massive, it now also supports dynamic Expandos too - read moreLike ActiveRecord, it supports a close relationship between object and database tableLike SubSonic, it supports generation of poco classes with T4 templatesLike Dapper, it's fast because it uses dynamic method generation (MSIL) to assign column values to properties Background PetaPoco was original inspired by Rob Conery's Massive project but for use with non-dynamic POCO objects. I needed a data acess layer that was tiny, fast, easy to use and could run on .NET 3.5 and/or Mono 2.6 (ie: no support for dynamic expandos). So, what's with the name? PetaPoco's line count has grown to more than I originally hoped - it's not the tiny 400 lines of Massive. Features at a Glance Download PetaPoco is available from: Hey!

ORM Comparison and Benchmarks on ORMBattle.NET SQLinq - use LINQ to generate Ad-Hoc Sql Queries

Related: