This document provides an overview of the RavenDB NoSQL document database. It begins with an introduction to NoSQL databases and describes the main classes. It then discusses RavenDB specifically - including that it is a transactional document database, is open source, and uses JSON storage with LINQ querying. Options for hosting RavenDB are presented. The document demonstrates basic CRUD operations on documents as well as modeling data, indexing, and advanced querying features like full-text search. It also briefly mentions upcoming RavenDB 3.0 features.
High level look at RavenDB features presented as a 10 minute lightning talk at the Nov 19 2013 BTVWag.org meeting of 8 lightning talks on NoSQL databases.
High level look at RavenDB features presented as a 10 minute lightning talk at the Nov 19 2013 BTVWag.org meeting of 8 lightning talks on NoSQL databases.
We will take a deep dive into ArangoDB (https://www.arangodb.com/) together with Max (https://www.linkedin.com/in/maxneunhoeffer) one of the core developers of the product.
ArangoDB is a multi-model database, which means that it is a document store, a key/value store and a graph database, all in one engine and with a query language that supports all three data models, as well as joins and transactions. Queries can use a single data model or can even mix them.
ArangoDB scales out horizontally with convenient cluster deployment using Apache Mesos. Furthermore, the HTTP API can easily be extended by server-side JavaScript code using high performance access to the C++ database core.
During the talk I will show all these features using several different cloud deployments, since in most projects one will not deploy a ArangoDB monolith, but rather multiple instances, each either a possibly replicated single server, or a cluster. This demonstrates that all these properties together make ArangoDB a very useful and valuable tool in modern microservice oriented architectures.
No SQL, No Problem: Use Azure DocumentDBKen Cenerelli
Introduction to Microsoft Azure DocumentDB. The slides have sections on Overview, Resource Model, Data Modeling, Performance, Development, Pricing and DocumentDB resources.
This talk was given at the following locales:
- DevTeach Montreal (July 6, 2016)
1er décembre 2015
Groupe Azure
Sujet: Introduction à DocumentDB
Conférencier: Vicent-Philippe Lauzon, Microsoft
Azure DocumentDB est une base de données de type NoSQL. Lors de cette introduction à DocumentDB, vous verrez:
• Ce qu'est une base de données NoSQL
• Comment DocumentDB se compare t-il face aux autres base de données Azure
• Comment DocumentDB se compare t-il face aux autres base de données NoSQL
• Comment créer et gérer une base DocumentDB
• Comment l'utiliser (outils + C#)
• Sécurité
• Performance / Capacité
Vincent-Philippe Lauzon est un Microsoft Azure Solution Architect & Machine Learning / Consultant Sénior chez CGI. Vous pouvez lire son blog http://vincentlauzon.com et le suivre sur Twitter https://twitter.com/vplauzon
Learn what you need to consider when moving from the world of relational databases to a NoSQL document store.
Hear from Developer Advocate Glynn Bird as he explains the key differences between relational databases and JSON document stores like Cloudant, as well as how to dodge the pitfalls of migrating from a relational database to NoSQL.
In this talk we present the term polyglot persistence, give a brief introduction to the world of NoSQL database and point out the benefits and costs of polyglot persistence. Thereafter we present the idea of a multi-model database that reduces the costs for polyglot persistence but keeps its benefits. Next up we present ArangoDB as a Multi-Model database
Benjamin Guinebertière - Microsoft Azure: Document DB and other noSQL databas...NoSQLmatters
When deploying your service to Microsoft Azure, you have a number of options in terms of noSQL: you can install databases on Linux or Windows virtual machines by yourself, or via the marketplace, or you can use open source databases available as a service like HBase or proprietary and managed databases like Document DB. After showing these options, we'll show Document DB in more details. This is a noSQL database as a service that stores JSON.
The Fine Art of Schema Design in MongoDB: Dos and Don'tsMatias Cascallares
Schema design in MongoDB can be an art. Different trade offs should be considered when designing how to store your data. In this presentation we are going to cover some common scenarios, recommended practices and don'ts to avoid based on previous experiences
We will take a deep dive into ArangoDB (https://www.arangodb.com/) together with Max (https://www.linkedin.com/in/maxneunhoeffer) one of the core developers of the product.
ArangoDB is a multi-model database, which means that it is a document store, a key/value store and a graph database, all in one engine and with a query language that supports all three data models, as well as joins and transactions. Queries can use a single data model or can even mix them.
ArangoDB scales out horizontally with convenient cluster deployment using Apache Mesos. Furthermore, the HTTP API can easily be extended by server-side JavaScript code using high performance access to the C++ database core.
During the talk I will show all these features using several different cloud deployments, since in most projects one will not deploy a ArangoDB monolith, but rather multiple instances, each either a possibly replicated single server, or a cluster. This demonstrates that all these properties together make ArangoDB a very useful and valuable tool in modern microservice oriented architectures.
No SQL, No Problem: Use Azure DocumentDBKen Cenerelli
Introduction to Microsoft Azure DocumentDB. The slides have sections on Overview, Resource Model, Data Modeling, Performance, Development, Pricing and DocumentDB resources.
This talk was given at the following locales:
- DevTeach Montreal (July 6, 2016)
1er décembre 2015
Groupe Azure
Sujet: Introduction à DocumentDB
Conférencier: Vicent-Philippe Lauzon, Microsoft
Azure DocumentDB est une base de données de type NoSQL. Lors de cette introduction à DocumentDB, vous verrez:
• Ce qu'est une base de données NoSQL
• Comment DocumentDB se compare t-il face aux autres base de données Azure
• Comment DocumentDB se compare t-il face aux autres base de données NoSQL
• Comment créer et gérer une base DocumentDB
• Comment l'utiliser (outils + C#)
• Sécurité
• Performance / Capacité
Vincent-Philippe Lauzon est un Microsoft Azure Solution Architect & Machine Learning / Consultant Sénior chez CGI. Vous pouvez lire son blog http://vincentlauzon.com et le suivre sur Twitter https://twitter.com/vplauzon
Learn what you need to consider when moving from the world of relational databases to a NoSQL document store.
Hear from Developer Advocate Glynn Bird as he explains the key differences between relational databases and JSON document stores like Cloudant, as well as how to dodge the pitfalls of migrating from a relational database to NoSQL.
In this talk we present the term polyglot persistence, give a brief introduction to the world of NoSQL database and point out the benefits and costs of polyglot persistence. Thereafter we present the idea of a multi-model database that reduces the costs for polyglot persistence but keeps its benefits. Next up we present ArangoDB as a Multi-Model database
Benjamin Guinebertière - Microsoft Azure: Document DB and other noSQL databas...NoSQLmatters
When deploying your service to Microsoft Azure, you have a number of options in terms of noSQL: you can install databases on Linux or Windows virtual machines by yourself, or via the marketplace, or you can use open source databases available as a service like HBase or proprietary and managed databases like Document DB. After showing these options, we'll show Document DB in more details. This is a noSQL database as a service that stores JSON.
The Fine Art of Schema Design in MongoDB: Dos and Don'tsMatias Cascallares
Schema design in MongoDB can be an art. Different trade offs should be considered when designing how to store your data. In this presentation we are going to cover some common scenarios, recommended practices and don'ts to avoid based on previous experiences
AWS Webcast - Build high-scale applications with Amazon DynamoDBAmazon Web Services
Review this webinar to learn about Amazon DynamoDB. DynamoDB is a highly scalable, fully managed NoSQL database service. Built for consistent single-digit millisecond latency and high availability, DynamoDB is a great fit for gaming, ad-tech, mobile, and many other applications.
Reasons to review:
• Learn the fundamentals of DynamoDB
• Understand how to design for common access patterns
• Discover best practices
• Hear how others uses DynamoDB to build their business
Who should review:
• Software Developers
• Database Administrators
• Solution Architects
• Technical Decision Makers
Media owners are turning to MongoDB to drive social interaction with their published content. The way customers consume information has changed and passive communication is no longer enough. They want to comment, share and engage with publishers and their community through a range of media types and via multiple channels whenever and wherever they are. There are serious challenges with taking this semi-structured and unstructured data and making it work in a traditional relational database. This webinar looks at how MongoDB’s schemaless design and document orientation gives organisation’s like the Guardian the flexibility to aggregate social content and scale out.
In the age of digital transformation and disruption, your ability to thrive depends on how you adapt to the constantly changing environment. MongoDB 3.4 is the latest release of the leading database for modern applications, a culmination of native database features and enhancements that will allow you to easily evolve your solutions to address emerging challenges and use cases.
In this webinar, we introduce you to what’s new, including:
- Multimodel Done Right. Native graph computation, faceted navigation, rich real-time analytics, and powerful connectors for BI and Apache Spark bring additional multimodel database support right into MongoDB.
- Mission-Critical Applications. Geo-distributed MongoDB zones, elastic clustering, tunable consistency, and enhanced security controls bring state-of-the-art database technology to your most mission-critical applications.
- Modernized Tooling. Enhanced DBA and DevOps tooling for schema management, fine-grained monitoring, and cloud-native integration allow engineering teams to ship applications faster, with less overhead and higher quality.
Webinar: Building Your First Application with MongoDBMongoDB
This webinar will introduce the features of MongoDB by walking through how one can building a simple location-based checkin application using MongoDB. The talk will cover the basics of MongoDB's document model, query language, map-reduce framework and deployment architecture.
Best practices on Building a Big Data Analytics Solution (SQLBits 2018 Traini...Michael Rys
From theory to implementation - follow the steps of implementing an end-to-end analytics solution illustrated with some best practices and examples in Azure Data Lake.
During this full training day we will share the architecture patterns, tooling, learnings and tips and tricks for building such services on Azure Data Lake. We take you through some anti-patterns and best practices on data loading and organization, give you hands-on time and the ability to develop some of your own U-SQL scripts to process your data and discuss the pros and cons of files versus tables.
This were the slides presented at the SQLBits 2018 Training Day on Feb 21, 2018.
MongoDB for Coder Training (Coding Serbia 2013)Uwe Printz
Slides of my MongoDB Training given at Coding Serbia Conference on 18.10.2013
Agenda:
1. Introduction to NoSQL & MongoDB
2. Data manipulation: Learn how to CRUD with MongoDB
3. Indexing: Speed up your queries with MongoDB
4. MapReduce: Data aggregation with MongoDB
5. Aggregation Framework: Data aggregation done the MongoDB way
6. Replication: High Availability with MongoDB
7. Sharding: Scaling with MongoDB
As your data grows, the need to establish proper indexes becomes critical to performance. MongoDB supports a wide range of indexing options to enable fast querying of your data, but what are the right strategies for your application?
In this talk we’ll cover how indexing works, the various indexing options, and use cases where each can be useful. We'll dive into common pitfalls using real-world examples to ensure that you're ready for scale.
Lessons from the Trenches - Building Enterprise Applications with RavenDBOren Eini
It's easy, fun, and simple to get a prototype application built with RavenDB, but what happens when you get to the point of shipping v1.0 into Production? Many of the subtle decisions made during development can have undesirable consequences in Production. In this session, Dan Bishop will explore some of the pain points that arise when building, deploying, and supporting enterprise-grade applications with RavenDB.
Arm yourself with Domain Driven Security. It's time to slay some security trollsOmegapoint Academy
We all know we have people like Anonymous, LulzSec, and NSA around. With this in mind, shouldn't we start thinking about the security of our systems? Well, of course. But, could you turn your knowledge of DDD into an advantage for understanding and counteracting security vulnerabilities? Yes, you could. This session is about exactly that. "Business" and "technical" attacks are two kinds of attacks, where the latter is the most famous, e.g. SQL Injection and Cross-Site Scripting. But this doesn't mean business attacks are less harmful. On the contrary, attacks on the business tend to be extremely sophisticated and powerful as they often leave the infrastructure intact and trigger no alarms. Domain Driven Security is the field that counteracts both types of attacks by using tools and mindsets from DDD in a clever way.
O'Reilly Velocity New York 2016 presentation on modern Linux tracing tools and technology. Highlights the available tracing data sources on Linux (ftrace, perf_events, BPF) and demonstrates some tools that can be used to obtain traces, including DebugFS, the perf front-end, and most importantly, the BCC/BPF tool collection.
Imagine you're tackling one of these evasive performance issues in the field, and your go-to monitoring checklist doesn't seem to cut it. There are plenty of suspects, but they are moving around rapidly and you need more logs, more data, more in-depth information to make a diagnosis. Maybe you've heard about DTrace, or even used it, and are yearning for a similar toolkit, which can plug dynamic tracing into a system that wasn't prepared or instrumented in any way.
Hopefully, you won't have to yearn for a lot longer. eBPF (extended Berkeley Packet Filters) is a kernel technology that enables a plethora of diagnostic scenarios by introducing dynamic, safe, low-overhead, efficient programs that run in the context of your live kernel. Sure, BPF programs can attach to sockets; but more interestingly, they can attach to kprobes and uprobes, static kernel tracepoints, and even user-mode static probes. And modern BPF programs have access to a wide set of instructions and data structures, which means you can collect valuable information and analyze it on-the-fly, without spilling it to huge files and reading them from user space.
In this talk, we will introduce BCC, the BPF Compiler Collection, which is an open set of tools and libraries for dynamic tracing on Linux. Some tools are easy and ready to use, such as execsnoop, fileslower, and memleak. Other tools such as trace and argdist require more sophistication and can be used as a Swiss Army knife for a variety of scenarios. We will spend most of the time demonstrating the power of modern dynamic tracing -- from memory leaks to static probes in Ruby, Node, and Java programs, from slow file I/O to monitoring network traffic. Finally, we will discuss building our own tools using the Python and Lua bindings to BCC, and its LLVM backend.
eBPF (extended Berkeley Packet Filters) is a modern kernel technology that can be used to introduce dynamic tracing into a system that wasn't prepared or instrumented in any way. The tracing programs run in the kernel, are guaranteed to never crash or hang your system, and can probe every module and function -- from the kernel to user-space frameworks such as Node and Ruby.
In this workshop, you will experiment with Linux dynamic tracing first-hand. First, you will explore BCC, the BPF Compiler Collection, which is a set of tools and libraries for dynamic tracing. Many of your tracing needs will be answered by BCC, and you will experiment with memory leak analysis, generic function tracing, kernel tracepoints, static tracepoints in user-space programs, and the "baked" tools for file I/O, network, and CPU analysis. You'll be able to choose between working on a set of hands-on labs prepared by the instructors, or trying the tools out on your own test system.
Next, you will hack on some of the bleeding edge tools in the BCC toolkit, and build a couple of simple tools of your own. You'll be able to pick from a curated list of GitHub issues for the BCC project, a set of hands-on labs with known "school solutions", and an open-ended list of problems that need tools for effective analysis. At the end of this workshop, you will be equipped with a toolbox for diagnosing issues in the field, as well as a framework for building your own tools when the generic ones do not suffice.
Swift: Apple's New Programming Language for iOS and OS XSasha Goldshtein
Presentation from Software Architect 2014, covering Swift -- Apple's new programming language for iOS and OS X. The presentation focuses on Swift's language features, which make it so different from mainstream programming languages. Towards the end of the live talk, we also built an iOS app using Swift.
C# Everywhere: Cross-Platform Mobile Apps with XamarinSasha Goldshtein
Presentation from Software Architect 2014, covering Xamarin's offering for building cross-platform mobile applications in C# while using the native platform APIs. The live talk also covered Xamarin.Forms.
Presentation from Software Architect 2014, covering modern cloud backends for mobile apps with a focus on Microsoft Azure Mobile Services and Facebook Parse.
Delivering Millions of Push Notifications in MinutesSasha Goldshtein
Presentation from TechDays Netherlands 2014 on using Azure Notification Hubs to deliver millions of push notifications - through a Mobile Services backend or through an arbitrary backend including Node.js or .NET console apps.
Building Mobile Apps with a Mobile Services .NET BackendSasha Goldshtein
Presentation from TechDays Netherlands 2014 on using the newly announced .NET backend for Azure Mobile Services to build mobile applications, and on using the Offline Sync preview in Windows Store apps.
Presentation from DevWeek 2014 on task and data parallelism. This session explains the TPL APIs and then covers various scenarios for extracting concurrency, reducing synchronization, putting thresholds on parallelization, and other topics.
O'Reilly Fluent 2014 talk on attacking web applications. Showing practical demos of attacking web assets, including XSS, CSRF, insecure cookie placement, traffic manipulation, and other tactics.
Presentation from ConFoo 2014 on Windows Azure Mobile Services. Introducing the platform, building out an application that uses data storage, server-side scripts, custom API endpoints, push notifications, and client authentication. Source code is available on GitHub at http://github.com/goldshtn/rentahome
Presentation from ConFoo 2014 on Android development. Introducing the Android platform, discussing the major components in the ecosystem, and building a basic todo list manager app with Eclipse.
Presentation at ConFoo 2014 on iOS Development. Discussing the basic components of the iOS ecosystem and building a basic todo list manager app with Xcode and storyboards.
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
JMeter webinar - integration with InfluxDB and GrafanaRTTS
Watch this recorded webinar about real-time monitoring of application performance. See how to integrate Apache JMeter, the open-source leader in performance testing, with InfluxDB, the open-source time-series database, and Grafana, the open-source analytics and visualization application.
In this webinar, we will review the benefits of leveraging InfluxDB and Grafana when executing load tests and demonstrate how these tools are used to visualize performance metrics.
Length: 30 minutes
Session Overview
-------------------------------------------
During this webinar, we will cover the following topics while demonstrating the integrations of JMeter, InfluxDB and Grafana:
- What out-of-the-box solutions are available for real-time monitoring JMeter tests?
- What are the benefits of integrating InfluxDB and Grafana into the load testing stack?
- Which features are provided by Grafana?
- Demonstration of InfluxDB and Grafana using a practice web application
To view the webinar recording, go to:
https://www.rttsweb.com/jmeter-integration-webinar
UiPath Test Automation using UiPath Test Suite series, part 4DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 4. In this session, we will cover Test Manager overview along with SAP heatmap.
The UiPath Test Manager overview with SAP heatmap webinar offers a concise yet comprehensive exploration of the role of a Test Manager within SAP environments, coupled with the utilization of heatmaps for effective testing strategies.
Participants will gain insights into the responsibilities, challenges, and best practices associated with test management in SAP projects. Additionally, the webinar delves into the significance of heatmaps as a visual aid for identifying testing priorities, areas of risk, and resource allocation within SAP landscapes. Through this session, attendees can expect to enhance their understanding of test management principles while learning practical approaches to optimize testing processes in SAP environments using heatmap visualization techniques
What will you get from this session?
1. Insights into SAP testing best practices
2. Heatmap utilization for testing
3. Optimization of testing processes
4. Demo
Topics covered:
Execution from the test manager
Orchestrator execution result
Defect reporting
SAP heatmap example with demo
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Let's dive deeper into the world of ODC! Ricardo Alves (OutSystems) will join us to tell all about the new Data Fabric. After that, Sezen de Bruijn (OutSystems) will get into the details on how to best design a sturdy architecture within ODC.
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
Search and Society: Reimagining Information Access for Radical FuturesBhaskar Mitra
The field of Information retrieval (IR) is currently undergoing a transformative shift, at least partly due to the emerging applications of generative AI to information access. In this talk, we will deliberate on the sociotechnical implications of generative AI for information access. We will argue that there is both a critical necessity and an exciting opportunity for the IR community to re-center our research agendas on societal needs while dismantling the artificial separation between the work on fairness, accountability, transparency, and ethics in IR and the rest of IR research. Instead of adopting a reactionary strategy of trying to mitigate potential social harms from emerging technologies, the community should aim to proactively set the research agenda for the kinds of systems we should build inspired by diverse explicitly stated sociotechnical imaginaries. The sociotechnical imaginaries that underpin the design and development of information access technologies needs to be explicitly articulated, and we need to develop theories of change in context of these diverse perspectives. Our guiding future imaginaries must be informed by other academic fields, such as democratic theory and critical theory, and should be co-developed with social science scholars, legal scholars, civil rights and social justice activists, and artists, among others.
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
Are you looking to streamline your workflows and boost your projects’ efficiency? Do you find yourself searching for ways to add flexibility and control over your FME workflows? If so, you’re in the right place.
Join us for an insightful dive into the world of FME parameters, a critical element in optimizing workflow efficiency. This webinar marks the beginning of our three-part “Essentials of Automation” series. This first webinar is designed to equip you with the knowledge and skills to utilize parameters effectively: enhancing the flexibility, maintainability, and user control of your FME projects.
Here’s what you’ll gain:
- Essentials of FME Parameters: Understand the pivotal role of parameters, including Reader/Writer, Transformer, User, and FME Flow categories. Discover how they are the key to unlocking automation and optimization within your workflows.
- Practical Applications in FME Form: Delve into key user parameter types including choice, connections, and file URLs. Allow users to control how a workflow runs, making your workflows more reusable. Learn to import values and deliver the best user experience for your workflows while enhancing accuracy.
- Optimization Strategies in FME Flow: Explore the creation and strategic deployment of parameters in FME Flow, including the use of deployment and geometry parameters, to maximize workflow efficiency.
- Pro Tips for Success: Gain insights on parameterizing connections and leveraging new features like Conditional Visibility for clarity and simplicity.
We’ll wrap up with a glimpse into future webinars, followed by a Q&A session to address your specific questions surrounding this topic.
Don’t miss this opportunity to elevate your FME expertise and drive your projects to new heights of efficiency.
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
As AI technology is pushing into IT I was wondering myself, as an “infrastructure container kubernetes guy”, how get this fancy AI technology get managed from an infrastructure operational view? Is it possible to apply our lovely cloud native principals as well? What benefit’s both technologies could bring to each other?
Let me take this questions and provide you a short journey through existing deployment models and use cases for AI software. On practical examples, we discuss what cloud/on-premise strategy we may need for applying it to our own infrastructure to get it to work from an enterprise perspective. I want to give an overview about infrastructure requirements and technologies, what could be beneficial or limiting your AI use cases in an enterprise environment. An interactive Demo will give you some insides, what approaches I got already working for real.
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Introduction to RavenDB
1. Seeking Life Beyond Relational:
RavenDB
Sasha Goldshtein
CTO, Sela Group
Level: Intermediate
2. NoSQL
•
The Zen-like answer: No one can tell you
what NoSQL is, they can only tell you what
it isn’t
•
It doesn’t use SQL
It usually is less consistent than RDBMS
It doesn’t put an emphasis on relations
It emphasizes size and scale over
structure
•
•
•
3. Classes of NoSQL Databases
Document DB
KeyValue
DB
Column
DB
Graph DB
4. RavenDB
•
•
•
•
•
•
•
•
Transactional document database Oren Eini
(Ayende Rahien)
Open source
https://github.com/ravendb/ravendb
with licensing for commercial projects
Schema-less documents, JSON storage
RESTful endpoints
LINQ-style .NET API
Implicit (usage-based) or explicit indexing
Powerful text search based on Lucene
Replication and sharding support
8. Opening a Session
•
•
DocumentStore is the session factory; one
per application is enough
Supports .NET connection strings or direct
initialization:
var ds = new DocumentStore
{
Url = "http://localhost:8888"
};
ds.Initialize();
9. CRUD Operations on Documents
•
Unit of work pattern (ORM-style)
using (var session = documentStore.OpenSession())
{
session.Store(new Speaker(“Sasha”, “Tel-Aviv”));
session.SaveChanges();
}
using (var session = documentStore.OpenSession())
{
Speaker sasha = session.Query<Speaker>()
.Where(e => e.City == “Tel-Aviv”).First();
sasha.City = “Orlando”;
session.SaveChanges();
}
10. Collections and IDs
•
•
•
•
Documents are stored in JSON format
Documents have metadata that includes
the entity type
A collection is a set of documents with the
same entity type
Documents have unique ids, often a
combination of collection name + id
– speakers/1
– conferences/7
12. Modeling Data as Documents
•
Don’t be tempted to use a document store
like a relational database
– Documents should be aggregate roots
– References to other documents are OK but (some)
data duplication (denormalization) is also OK
“conference/11” : {
tracks: [
{ title: “Web”, days: { 1, 2 }, sessions: [ ... ] },
...
]
Should the tracks be
}
references?
13. …But Don’t Go Too Far
•
Is this a reasonable document?
“blogs/1” : {
tags : [ “Windows”, “Visual Studio”, “VSLive” ],
posts : [
My blog has 500 posts
{ title: “Migrating to RavenDB”,
content: “When planning a migration to Raven…”,
author: “Sasha Goldshtein”,
comments: [ ... ]
...
},
...
]
}
14. One More Example
“orders/1783”: {
customer: { name: “James Bond”, id: “customers/007” },
items: [
{ product: “Disintegrator”, cost: 78.3, qty: 1 },
{ product: “Laser shark”,
cost: 99.0, qty: 3 }
]
}
What if we always need
to know whether the
product is in stock?
What if we always need
the customer’s address?
What if the customer’s
address changes often?
15. Include
•
Load the referenced document when the
referencing document is retrieved
– Also supports arrays of referenced documents
Order order = session.Include<Order>(o => o.Customer.Id)
.Load(“orders/1783”);
Customer customer = session.Load<Customer>(
order.Customer.Id);
Order[] orders = session.Query<Order>()
.Customize(q => q.Include<Order>(o => o.Customer.Id))
.Where(o => o.Items.Length > 5)
.ToArray();
17. Indexes
•
RavenDB automatically creates indexes
for you as you run your queries
– The indexing happens in the background after
changes are made to the database
– Indexes can become stale
– Can wait for non-stale results (if necessary)
RavenQueryStatistics stats;
var results = session.Query<Speaker>()
.Statistics(out stats)
.Where(s => s.Experience > 3)
.ToArray();
if (stats.IsStale) ...
18. ACID?
•
If indexes can become stale, does it mean
RavenDB is not ACID?
•
The document store is ACID
The index store is not
•
•
You can insert lots of data very quickly
and load it quickly, but indexes take a
while to catch up
19. Indexing Fundamentals
•
•
A document has fields that are indexed
individually
An index points from sorted field values to
matching documents
Customer
Document IDs
"orders/1" : {
customer: "Dave", price: 200, items: 3
}
Dave
orders/1, orders/3
Mike
orders/2
"orders/2" : {
customer: "Mike", price: 95, items: 1
}
Price
Document IDs
95
orders/2
150
orders/3
200
orders/1
"orders/3" : {
customer: "Dave", price: 150, items: 2
}
20. Static (Manual) Indexes
•
•
Static indexes can provide map and
reduce functions to specify what to index
The simplest form specifies a map
function with the fields to index:
ds.DatabaseCommands.PutIndex(“Speaker/ByCity”,
new IndexDefinitionBuilder<Speaker> {
Map = speakers => from speaker in speakers
select new { speaker.City }
}
);
21. Hierarchical Data
•
How to index the following hierarchy of
comments by author and text?
public class Post
{
public string Title { get; set; }
public Comment[] Comments { get; set; }
}
public class Comment
{
public string Author { get; set; }
public string Text { get; set; }
public Comment[] Comments { get; set; }
}
22. Hierarchical Index with Recurse
public class CommentsIndex : AbstractIndexCreationTask<Post>
{
public CommentsIndex()
{
Map = posts => from post in posts
from comment in Recurse(post, c=>c.Comments)
select new
{
Author = comment.Author,
Text = comment.Text
}
}
}
This is an index over Post
objects but the output
produces Comment objects!
23. Map/Reduce Index
•
We often need the speaker count for each
of our conferences:
class SpeakerCount : Tuple<string, int> {}
ds.DatabaseCommands.PutIndex(“Conferences/SpeakerCount”,
new IndexDefinitionBuilder<Conference, SpeakerCount> {
Map = conferences => from conf in conferences
from speaker in conf.Speakers
select new { Item1 = speaker.Name, Item2 = 1 },
Reduce =
results => from result in results
group result by result.Item1 into g
select new { Item1 = g.Key, Item2 = g.Sum(x => x.Item2) }
}
);
24. Using Indexes
•
•
In most cases you simply run a query and it will
implicitly use or create an index
Or, instruct the query to use your index:
var d = session.Query<SpeakerCount>(“Conferences/SpeakerCount”)
.FirstOrDefault(s => s.Item1 == “Dave”);
Console.WriteLine(“Dave spoke at {0} conferences”, d.Item2);
var posts = session.Query<Comment>(“CommentsIndex”)
.Where(c => c.Author == “Mike”)
.OfType<Post>();
25. Indexing Related Documents
Use the LoadDocument method
•
session.Query<OrderCustomerCityIndex.Result, OrderCustomerCityIndex>()
public class OrderCustomerCityIndex :
.Where(c => c.City == “Orlando”)
AbstractIndexCreationTask<Order, OrderCustomerCityIndex.Result>
.OfType<Order>()
.ToList();
{
public class Result { public string City; }
public OrderCustomerCityIndex()
{
Map = orders => from order in orders
select new
{
City = LoadDocument(order.Customer.Id).City
}
}
}
27. Full-Text Search Indexes
Made possible by the underlying Lucene.NET
engine
•
public class SpeakerIndex : AbstractIndexCreationTask<Speaker>
{
public SpeakerIndex()
{
Map = speakers => from speaker in speakers
select new { speaker.Name };
Index("Name", FieldIndexing.Analyzed);
}
}
28. Using Full-Text Search and Query
Suggestions
var query = session.Query<Speaker, SpeakerIndex>()
.Where(s => s.Name == name);
var speaker = query.FirstOrDefault();
Will find “Dave Smith” when
searching for “dave” or “smith”
if (speaker == null)
{
Will suggest “dave” when
searching for “david”
string[] suggestions = query.Suggest().Suggestions;
}
29. Using Lucene Directly
•
•
You can also query Lucene directly on any
analyzed fields
E.g., fuzzy search for sessions:
string query = String.Format("Title:{0}*", term);
session.Advanced.LuceneQuery<Session>("SessionIndex")
.Where(query)
.ToList();