SlideShare a Scribd company logo
RavenDB lovin’
  .NET does NoSQL
about:author
Longtime user of ORMs

Experienced in object DBs

Raven in personal projects

Raven at 3M

Raven with Ayende!
RavenDB?
SQL: Databases done right.
       Circa 1970.
SQL: Databases done right.
       Circa 1970.




   CAP Theorem for distributed systems:
 Consistency, Availability, Partition tolerance
                 Choose 2.
SQL: Databases done right.
       Circa 1970.
SQL: Databases done right.
       Circa 1970.
SQL: Databases done right.
       Circa 1970.

SELECT UPPER(Name)    SELECT UPPER(Name)        SELECT TOP 10 UPPER                     $ SET SOURCEFORMAT “FREE”
FROM Customer         FROM                      (c1.Name)                               IDENTIFICATION DIVISION.
WHERE Name LIKE'A%'   (                         FROM Customer c1                        Display Prompt.
ORDER BY Name             SELECT *,             WHERE c1.Name LIKE 'A%'                    DISPLAY “I <3 SQL!”.
                          RN = row_number()     AND c1.ID NOT IN                           STOP RUN.
                          OVER (ORDER BY        (
                      Name)                        SELECT TOP 20 c2.ID
                          FROM Customer            FROM Customer c2
                          WHERE Name LIKE          WHERE c2.Name LIKE 'A%‘
                      'A%'                         ORDER BY c2.Name
                      ) A                       ) ORDER BY c1.Name
                      WHERE RN BETWEEN 21 AND
                      30
                      ORDER BY Name

                                                   var names = db.Customers
                                                                 .Where(c => c.Name.StartsWith(“A”))
                                                                 .OrderBy(c => c.Name)

    Or how about…                                                .Select(c => c.Name.ToUpper())
                                                                 .Skip(20)
                                                                 .Take(10);
SQL: Because objects and relational
   databases go together like
   peanut butter and tuna fish
SQL + OO =
Peanut butter + Tuna.


 The object-relational impedance mismatch:
   •Polymorphism doesn’t exist in the relational world
   •Encapsulation creates fragile database models
   •Inheritance results in inefficient relational queries
   •Leaky abstraction
SQL + OO =




…but you can mask the tuna only so long…
SQL + OO =
                var today= DateTime.Now;
                context.TheBaseTypes
                  .Where(b => b.DateCreated == today)
                  .ToList();


“Expressing this query in LINQ to Entities is short and sweet. But
don’t be fooled. It’s a hefty request. You’re asking EF and your DB
query each table that maps to the derived entities and join each
one to the BaseTypes table.

In my environment, this creates a 3,200 line SQL query, which can
take Entity Framework some time to build and the database some
time to execute.”

-Julie Lerman, MSDN Magazine, August 2012
ORM: The Vietnam of
 Computer Science
  “ORM is the Vietnam of Computer Science.

  It represents a quagmire which starts well,
  gets more complicated as time passes, and
  before long entraps its users in a
  commitment that has no clear demarcation
  point, no clear win conditions, and no clear
  exit strategy.”

  -Ted Neward
SQL:
The Hammer for every
        nail


 “The first to present his case seems right,
  till another comes forward
  and questions him.”
NoSQL:
A modern alternative to relational
           databases



                     Don’t use T-SQL

                  Typically schema-free

              Built for distributed scalability

                 Relax ACID guarantees
NoSQL:
A modern alternative to relational
           databases



       Trippy things like…

          Cheap, fast reads

        Horizontal scalability

     Flexible, schema-free models
NoSQL has problems,
       too.
NoSQL has problems,
       too.
     Painful query models

      Immature tooling

        Complex APIs

    Poor language support
RavenDB

“I’ve consulted on NHibernate and other
ORMs for over a decade. I’ve seen the same
problems repeated over and over.

I wanted to fix that.
So I created RavenDB.”

-Ayende
RavenDB

       Get out of the RDBMS/ORM mess
          Fix shortcomings of NoSQL

              Evolve data storage
“I intentionally designed RavenDB and its .NET
API to deal with problems and frustrations in the
NHibernate / RDMBS model.”

-Ayende
RavenDB

Setup should be painless
RavenDB

Simple is better
RavenDB

Putting stuff in the database should be easy
RavenDB

Transactions are important
RavenDB

LINQ is the best query language on the planet
RavenDB

Developers should fall into the pit of success
RavenDB

Reads should be *fast*. Index fast.

             Lock-free, non-ACID reads

   “Better stale data quickly than live data slowly.”

     Every read is a query against an index. Yes!

    Indexes should be created
RavenDB

Tooling is important
RavenDB

Search matters. Google-like search.
RavenDB
Scalability should be easy, natural
      Replication: master-to-slave, master-to-master
    Sharding: split your data across servers transparently
Recap!
                         It’s an alternative to the
                         SQL + ORM mess

Raven is scalable!
                         You should totally use it for
                         your next project :-)
Thank You!
Slides: bit.ly/raventalk



                                  Twitter: @JudahGabriel




      Blog: DebuggerDotBreak.wordpress.com

More Related Content

PDF
SimpleDb, an introduction
PPT
Document Databases & RavenDB
PPTX
Dev Life Made Better with RavenDB
PPTX
RavenDB Overview
PPTX
Intro to RavenDB
PPTX
The Rise of NoSQL and Polyglot Persistence
PPTX
No sql introduction_v1.1.1
PPT
Object Relational Mapping with LINQ To SQL
SimpleDb, an introduction
Document Databases & RavenDB
Dev Life Made Better with RavenDB
RavenDB Overview
Intro to RavenDB
The Rise of NoSQL and Polyglot Persistence
No sql introduction_v1.1.1
Object Relational Mapping with LINQ To SQL

Similar to Raven lovin' - .NET does NoSQL (20)

PDF
Sql no sql
PDF
Bristol Uni - Use Cases of NoSQL
PPTX
Session #4: Treating Databases as First-Class Citizens in Development
PPTX
PHX - Session #4 Treating Databases as First-Class Citizens in Development
ZIP
Forget The ORM!
PDF
NoSQL: An Architects Perspective
PDF
Exalead managing terrabytes
PPTX
NoSQL and The Big Data Hullabaloo
PPTX
A Practical Look at the NOSQL and Big Data Hullabaloo
PPTX
Databases for Storage Engineers
PDF
10 d bs in 30 minutes
PDF
Scaling the Web: Databases & NoSQL
PDF
Architectural anti-patterns for data handling
PPTX
Anti-social Databases
PPTX
SQL Server Development Tools & Processes Using Visual Studio 2010
PPTX
Easy Data Object Relational Mapping Tool
PDF
What Drove Wordnik Non-Relational?
PDF
Finding the Right Data Solution for your Application in the Data Storage Hays...
PPTX
Big Data (NJ SQL Server User Group)
PPT
SQL, NoSQL, BigData in Data Architecture
Sql no sql
Bristol Uni - Use Cases of NoSQL
Session #4: Treating Databases as First-Class Citizens in Development
PHX - Session #4 Treating Databases as First-Class Citizens in Development
Forget The ORM!
NoSQL: An Architects Perspective
Exalead managing terrabytes
NoSQL and The Big Data Hullabaloo
A Practical Look at the NOSQL and Big Data Hullabaloo
Databases for Storage Engineers
10 d bs in 30 minutes
Scaling the Web: Databases & NoSQL
Architectural anti-patterns for data handling
Anti-social Databases
SQL Server Development Tools & Processes Using Visual Studio 2010
Easy Data Object Relational Mapping Tool
What Drove Wordnik Non-Relational?
Finding the Right Data Solution for your Application in the Data Storage Hays...
Big Data (NJ SQL Server User Group)
SQL, NoSQL, BigData in Data Architecture
Ad

Recently uploaded (20)

PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Machine Learning_overview_presentation.pptx
PPTX
Tartificialntelligence_presentation.pptx
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
cuic standard and advanced reporting.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
Spectroscopy.pptx food analysis technology
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Approach and Philosophy of On baking technology
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
Mobile App Security Testing_ A Comprehensive Guide.pdf
Machine Learning_overview_presentation.pptx
Tartificialntelligence_presentation.pptx
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
cuic standard and advanced reporting.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
The Rise and Fall of 3GPP – Time for a Sabbatical?
gpt5_lecture_notes_comprehensive_20250812015547.pdf
MYSQL Presentation for SQL database connectivity
Spectroscopy.pptx food analysis technology
Spectral efficient network and resource selection model in 5G networks
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Unlocking AI with Model Context Protocol (MCP)
Approach and Philosophy of On baking technology
“AI and Expert System Decision Support & Business Intelligence Systems”
20250228 LYD VKU AI Blended-Learning.pptx
Accuracy of neural networks in brain wave diagnosis of schizophrenia
Ad

Raven lovin' - .NET does NoSQL

  • 1. RavenDB lovin’ .NET does NoSQL
  • 2. about:author Longtime user of ORMs Experienced in object DBs Raven in personal projects Raven at 3M Raven with Ayende!
  • 4. SQL: Databases done right. Circa 1970.
  • 5. SQL: Databases done right. Circa 1970. CAP Theorem for distributed systems: Consistency, Availability, Partition tolerance Choose 2.
  • 6. SQL: Databases done right. Circa 1970.
  • 7. SQL: Databases done right. Circa 1970.
  • 8. SQL: Databases done right. Circa 1970. SELECT UPPER(Name) SELECT UPPER(Name) SELECT TOP 10 UPPER $ SET SOURCEFORMAT “FREE” FROM Customer FROM (c1.Name) IDENTIFICATION DIVISION. WHERE Name LIKE'A%' ( FROM Customer c1 Display Prompt. ORDER BY Name SELECT *, WHERE c1.Name LIKE 'A%' DISPLAY “I <3 SQL!”. RN = row_number() AND c1.ID NOT IN STOP RUN. OVER (ORDER BY ( Name) SELECT TOP 20 c2.ID FROM Customer FROM Customer c2 WHERE Name LIKE WHERE c2.Name LIKE 'A%‘ 'A%' ORDER BY c2.Name ) A ) ORDER BY c1.Name WHERE RN BETWEEN 21 AND 30 ORDER BY Name var names = db.Customers .Where(c => c.Name.StartsWith(“A”)) .OrderBy(c => c.Name) Or how about… .Select(c => c.Name.ToUpper()) .Skip(20) .Take(10);
  • 9. SQL: Because objects and relational databases go together like peanut butter and tuna fish
  • 10. SQL + OO = Peanut butter + Tuna. The object-relational impedance mismatch: •Polymorphism doesn’t exist in the relational world •Encapsulation creates fragile database models •Inheritance results in inefficient relational queries •Leaky abstraction
  • 11. SQL + OO = …but you can mask the tuna only so long…
  • 12. SQL + OO = var today= DateTime.Now; context.TheBaseTypes .Where(b => b.DateCreated == today) .ToList(); “Expressing this query in LINQ to Entities is short and sweet. But don’t be fooled. It’s a hefty request. You’re asking EF and your DB query each table that maps to the derived entities and join each one to the BaseTypes table. In my environment, this creates a 3,200 line SQL query, which can take Entity Framework some time to build and the database some time to execute.” -Julie Lerman, MSDN Magazine, August 2012
  • 13. ORM: The Vietnam of Computer Science “ORM is the Vietnam of Computer Science. It represents a quagmire which starts well, gets more complicated as time passes, and before long entraps its users in a commitment that has no clear demarcation point, no clear win conditions, and no clear exit strategy.” -Ted Neward
  • 14. SQL: The Hammer for every nail “The first to present his case seems right, till another comes forward and questions him.”
  • 15. NoSQL: A modern alternative to relational databases Don’t use T-SQL Typically schema-free Built for distributed scalability Relax ACID guarantees
  • 16. NoSQL: A modern alternative to relational databases Trippy things like… Cheap, fast reads Horizontal scalability Flexible, schema-free models
  • 18. NoSQL has problems, too. Painful query models Immature tooling Complex APIs Poor language support
  • 19. RavenDB “I’ve consulted on NHibernate and other ORMs for over a decade. I’ve seen the same problems repeated over and over. I wanted to fix that. So I created RavenDB.” -Ayende
  • 20. RavenDB Get out of the RDBMS/ORM mess Fix shortcomings of NoSQL Evolve data storage “I intentionally designed RavenDB and its .NET API to deal with problems and frustrations in the NHibernate / RDMBS model.” -Ayende
  • 23. RavenDB Putting stuff in the database should be easy
  • 25. RavenDB LINQ is the best query language on the planet
  • 26. RavenDB Developers should fall into the pit of success
  • 27. RavenDB Reads should be *fast*. Index fast. Lock-free, non-ACID reads “Better stale data quickly than live data slowly.” Every read is a query against an index. Yes! Indexes should be created
  • 30. RavenDB Scalability should be easy, natural Replication: master-to-slave, master-to-master Sharding: split your data across servers transparently
  • 31. Recap! It’s an alternative to the SQL + ORM mess Raven is scalable! You should totally use it for your next project :-)
  • 32. Thank You! Slides: bit.ly/raventalk Twitter: @JudahGabriel Blog: DebuggerDotBreak.wordpress.com

Editor's Notes

  • #6: Consistency: all nodes see the same data at the same timeAvailability: a guarantee that every request receives a response about whether it was successful or failedPartition tolerance: the system continues to operate despite arbitrary message loss or failure of part of the system
  • #11: The object-relational impedance mismatch is a set of conceptual and technical difficulties that are often encountered when a relational database management system (RDBMS) is being used by a program written in an object-oriented programming language or style; particularly when objects or class definitions are mapped in a straightforward way to database tables or relational schemata.
  • #28: BASE: Basically available, soft state, eventually consistent