SlideShare ist ein Scribd-Unternehmen logo
1 von 87
Test driving Azure
Search and
DocumentDB
Andrew Siemer | Clear Measure
andrew@clear-measure.com
@asiemer
Andrew Siemer
http://about.me/andrewsiemer
ASP Insider
MS v-TSP (Azure)
Azure Advisor Program
Father of 6. Jack of all trades, master of some.
Writing a book on Azure
• LeanPub
• GitHub
• Written in the open
• Want to help?
 We are hiring!!!
Join us at
AzureAustin
http://www.meetup.com/AzureAustin
Introduction
• DocumentDB
• Azure Search
• Where might you use each?
DocumentDB
is
NOSQL
What is NOSQL?
When is NoSQL better than N
• Unstructured data
• Favors data that is immediately related
• Denormalized (or flat) data
• Need easy scaling options – distributed by default (add nodes)
• When you don’t need transactions across collections
When not to use NoSQL
• Need to do heavy joins across collections
• When many to many query depth is unknown
• User has a collection of users (friends) which have a collection of users
Azure Search
is
Elastic Search
What is search?
• Indexes
• Documents
• Fields
• Types of searchability
• Retrievable
• Non-retrievable
• Tokenization
• Facets
• Scoring
When to use search
• Need an easy way to score results
• Fuzzy searching is easy
• Finely control results around business rules
• Ability to boost newer results
• Built around distributed first (over SOLR, others)
When not to use search
• Large computational work
• Need real time data access
• Small budget AND high availability
Example
application
Example site: jeep listings
• Listings contain:
• A picture of a Jeep
• Various jeep options
• Dealer information
• Price info
Example site: jeep listings
Let’s see the
application
DocumentDB
How to set up DocumentDB
Let’s create a new Document DB
• …is Azure up and available?
DocumentDB high points
• Has a Microsoft provided SDK via Nuget
• Uses auth key for security
• Everything is based on a capacity unit
• Up to 5 capacity units available for preview
• 10GB per capacity unit
• 2000 requests per second
• $.73/day ($22.50 per month)
• Average operations per second per capacity unit
• Based on simple structure
• 2000 read of a single document
• 500 inserts, replaces, or deletes
• 1000 queries returning a single document
Elastic SSD
• Makes collection truly elastic
• Add/Remove documents grows/shrinks collection
• Tested with real-world clients from gigabytes to terrabytes
Automatic Indexing
• Indexing on by default
• Can optimize for performance and storage tradeoffs
• Index only specific paths in your document
• Synchronous indexing at write time by default
• Can be Asynchronous for boosted write performance
• Eventually consistent
Document Explorer
• There is a tool to manage docs
• Not terribly useful!
• …yet
…not that useful yet
Understanding the DocumentDB structure
Structure: Database
• The container that houses your data
• /db/{id} is not your ID
• Hash known as a “Self Link”
Structure: Media
• Video
• Audio
• Blob
• Etc.
Structure: User
• Invite in an existing azure account
• Allows you to set permissions on
each concept of the database
Structure: Permission
• Authorization token
• Associated with a user
• Grants access to a given resource
Structure: Collection
• Most like a “table”
• Structure is not defined
• Dynamic shapes based on what
you put in it
Structure: Document
• A blob of JSON representing your data
• Can be a deeply nested shape
• No specialty types
• No specific encoding types
Structure: Attachment
• Think media – at the document level!
Structure: Stored Procedure
• Written in javascript!
• Is transactional
• Executed by the database engine
• Can live in the store
• Can be sent over the wire
Structure: Triggers
• Can be Pre or Post (before or after)
• Can operate on the following actions
• Create
• Replace
• Delete
• All
• Also written in javascript!
Structure: UDF
• Can only be ran on a query
• Modifies the result of a given query
• mathSqrt()
Create a document store
• Everything is done asynchronously!
• The ID of a new database is the friendly name
database = await GetClient().CreateDatabaseAsync(new Database { Id = id });
Adding data
• Since DocumentDB is dynamic you just throw data in
await client.CreateDocumentAsync(documentCollection.SelfLink, listing);
Batch operations
• Not necessarily a built in operation
• Can be done with a stored procedure that takes a collection of
documents (JSON)
Querying
• Everything is done asynchronously in the SDK
• The ID of a new database is the friendly name
• Everything references the “SelfLink”
• This is the internal ID of the resource you are working with
• Used to build up the API call
http://azure.microsoft.com/en-us/documentation/articles/documentdb-sql-query/
Querying: Simple
• SELECT * FROM
var client = GetClient();
var collection = await GetCollection(client, Keys.ListingsDbName,
Keys.ListingDbCollectionName);
string sql = String.Format("SELECT * FROM {0}", Keys.ListingDbCollectionName);
var jeepsQuery = client.CreateDocumentQuery<Listing>(collection.SelfLink,
sql).ToArray();
var jeeps = jeepsQuery.ToArray();
Querying: More complex
• Joining requires the shape to be specified
var client = GetClient();
var collection = await GetCollection(client, Keys.ListingsDbName,
Keys.ListingDbCollectionName);
string sql = String.Format(@"SELECT l.Color, l.Options, l.Package, l.Type, l.Image,
l.Dealer, l.Id
FROM {0} l
JOIN o IN l.Options
WHERE o.Name = 'hard top'", Keys.ListingDbCollectionName);
var hardtopQuery = client.CreateDocumentQuery<Listing>(collection.SelfLink,
sql).ToArray();
REST API
• Everything is done via a REST call!
Create data request Query data request
Interactive query demo online
• Microsoft has provided an interactive demo for you to play with
• http://www.documentdb.com/sql/demo
Questions on
Document DB?
Azure Search
What is search?
You mean “where [field] like ‘%query%’” isn’t a search
engine?
NOPE!!!!
What is search?
• Indexes
• Documents
• Fields
• Types of searchability
• Retrievable
• Non-retrievable
• Tokenization
• Facets
• Scoring
What is Azure Search Preview?
• Hosted
• High performance
• Horizontally scalable
• Elastic Search under the covers
Concerns with the preview?
• English only
• No additional tokenization strategies
• Standard: treats white space and punctuation as delimiters
• Keyword: treats entire string as a token
• Fixed fields (can’t remove)
• No document level security
Setting up Azure Search
Creating a search instance
Azure Search Options
• “Standard” can be scaled based on workload
• “Shared” is free and solely for testing (no perf guarantees)
• REST API access only – no SDK from Microsoft yet
• RedDog.Search is available on Nuget
• Security is limited to API key
Quick specs
What Free Standard
Size 50mb 25gb per unit
Queries per second N/A 15 per unit
Number of documents 10,000 across 3 indexes 15M per unit, 50 index limit
Scale out limits N/A Up to 36 units
Price Free $.168/hour, $125/month
Understanding “units”
More replicas equals more performance
More partitions equals more documents and more space
• 1 replica + 1 partition = 1 search unit
• 6 replicas + 1 partition = (1 replica & 1 partition) + 5 replicas = 6
search units
• 2 replicas + 2 partitions = (1 replica & 1 partition) + (1 replica & 1
partition) = 2 search units
No SDK yet!
• RedDog.Search
• Provided via Nuget and on GitHub
• Also all asynchronous
• AdventureWorksCatalog – sample code
• Great example of composing REST requests
• http://azure.microsoft.com/en-us/documentation/articles/search-create-first-
solution/
Azure Search is structured
• A search index has a predefined structure
• It is not dynamic
• Each field in the index has characteristics defined when created
• Filterable?
• Searchable?
• Faceted?
• Retrievable?
• Sortable?
Field Characteristics: Key
• Required!
• Can only be on one field for the document
• Can be used to look up a document directly
• Update
• Delete
Field Characteristics: Searchable
• Makes the field full-text-search-able
• Breaks the words of the field for indexing purposes
• “Big Red Jeep” will become separate components
• A search for “big”, “red”, “jeep”, or “big jeep” will hit this record
• Other field types are not searchable!
• Searchable fields cause bloat!
• Only make it searchable if it needs to be
Field Characteristics: Filterable
• Doesn’t under go word breaking
• Exact matches only
• Only searches for “big red jeep” will hit a “big red jeep” record
• All fields are filterable by default
Field Characteristics: Sortable
• By default, results are sorted by score
• Strings are not sortable!
• All other types are sortable by default
Field Characteristics: Facetable
• Geography points are not facetable
• All other fields are facetable by default
• Used to rank records by other notions
• Jeeps that sold by this {dealer}
• Jeeps that are this {color}
Field Characteristics: Suggestions
• Used for auto-complete
• Only for string or collection of string
• False by default
• Causes bloat in the index!
Field Characteristics: Retrievable
• Allows the field to be returned in the search results
• Key fields must be retrievable
Field Characteristics: can be false
• If turning a feature on expands the index…
• only turn it one when you intend to use it!
"filterable": false, "sortable": false, "facetable": false, "suggestions": false
Creating an index
var newIndex = new Index(Keys.ListingsServiceIndexName)
.WithStringField("Id", opt => opt.IsKey().IsRetrievable())
.WithStringField("Color", opt => opt.IsSearchable()
.IsSortable()
.IsFilterable()
.IsRetrievable()
.IsFacetable())
.WithStringField("Package", opt => opt.IsSearchable()
.IsFilterable()
.IsRetrievable()
.IsFacetable())
...
index = await managementClient.CreateIndexAsync(newIndex);
Index naming
• I found this out the hard way
…index names must be all lower case, digits, or dashes – 128 character max
Scoring Profiles
• Gives you greater control over the results
• Control over boosting documents based on freshness
• Distance allows you to boost documents that are “closer”
• Based on geographic location
• Magnitude scoring alters ranking based on a range of values
• Highest rated
• Produces the highest margin
Interpolations
• Slope at which boosting increases from range start to end
• Linear – constant decreasing amount
• Default
• Constant – constant boost is applied
• Quadratic – slow to fast boost drop off
• Logarithmic – fast to slow boost drop off
Interpolations
Adding a scoring profile
• Can be added to the index at any time
var sp = new ScoringProfile();
sp.Name = "ByTypeAndPackage";
sp.Text = new ScoringProfileText();
sp.Text.Weights = new Dictionary<string, double>();
sp.Text.Weights.Add("Type", 1.5);
sp.Text.Weights.Add("Package", 1.5);
newIndex.ScoringProfiles.Add(sp);
Adding data to the index
• Need to map your object to your index
var op = new IndexOperation(IndexOperationType.Upload, "Id", l.Id.ToString())
.WithProperty("Color", l.Color)
.WithProperty("Options", flatOptions)
.WithProperty("Package", l.Package)
.WithProperty("Type", l.Type)
.WithProperty("Image", l.Image);
operations.Add(op);
var result = await managementClient.PopulateAsync(Keys.ListingsServiceIndexName,
operations.ToArray());
Batch operations
• The previous code was a batch operation
• You can batch up to 1000 “operations” in one call
• Can be any operation in the batch
• Adds
• Deletes
• Updates
Querying the index
• Have to specify what fields you want returned
• Can only output retrievable fields
var conn = ApiConnection.Create(Keys.ListingsServiceUrl, Keys.ListingsServiceKey);
var queryClient = new IndexQueryClient(conn);
var query = new SearchQuery(search)
.Count(true)
.Select("Id,Color,Options,Type,Package,Image")
.OrderBy("Color");
var searchResults = await queryClient.SearchAsync(Keys.ListingsServiceIndexName, query);
Questions on
Azure Search?
Where might I use
them?
Where does it fit?
Client
Web API
queue
Service
Event Store
nosql
Saga Storage
nosql
queue Service
nosql
relational
warehouse reporting site
Admin site
search
search
NOSQL
SEARCH
Where does it fit?
Client
Web API
queue
Service
Event Store
nosql
Saga Storage
nosql
queue Service
nosql
relational
warehouse reporting site
Admin site
search
search
NOSQL
SEARCH
CQRS Event Store
Saga persistence
Denormalized
view data
Where does it fit?
Client
Web API
queue
Service
Event Store
nosql
Saga Storage
nosql
queue Service
nosql
relational
warehouse reporting site
Admin site
search
search
NOSQL
SEARCH
Search first
navigation
Data/Decision
enrichment
Any questions on
where they fit?
Questions?
Andrew Siemer
Clear Measure
andrew@clear-measure.com
(512) 387-1976
@asiemer
Code and slides:
https://github.com/asiemer/AzureJeeps
You can find me here:
http://www.andrewsiemer.com
http://www.siemerforhire.com
http://about.me/AndrewSiemer
AzureAustin
http://www.meetup.com/AzureAustin

Weitere ähnliche Inhalte

Was ist angesagt?

Lessons from the Trenches - Building Enterprise Applications with RavenDB
Lessons from the Trenches - Building Enterprise Applications with RavenDBLessons from the Trenches - Building Enterprise Applications with RavenDB
Lessons from the Trenches - Building Enterprise Applications with RavenDBOren Eini
 
Command Query Responsibility Segregation (CQRS)
Command Query Responsibility Segregation (CQRS)Command Query Responsibility Segregation (CQRS)
Command Query Responsibility Segregation (CQRS)Derek Comartin
 
Rev Your Engines: SharePoint Performance Best Practices
Rev Your Engines: SharePoint Performance Best PracticesRev Your Engines: SharePoint Performance Best Practices
Rev Your Engines: SharePoint Performance Best PracticesSPC Adriatics
 
Building Codealike: a journey into the developers analytics world
Building Codealike: a journey into the developers analytics worldBuilding Codealike: a journey into the developers analytics world
Building Codealike: a journey into the developers analytics worldOren Eini
 
Azure CosmosDB the new frontier of big data and nosql
Azure CosmosDB the new frontier of big data and nosqlAzure CosmosDB the new frontier of big data and nosql
Azure CosmosDB the new frontier of big data and nosqlRiccardo Cappello
 
Elastic & Azure & Episever, Case Evira
Elastic & Azure & Episever, Case EviraElastic & Azure & Episever, Case Evira
Elastic & Azure & Episever, Case EviraMikko Huilaja
 
Episerver and search engines
Episerver and search enginesEpiserver and search engines
Episerver and search enginesMikko Huilaja
 
Cloud architectural patterns and Microsoft Azure tools
Cloud architectural patterns and Microsoft Azure toolsCloud architectural patterns and Microsoft Azure tools
Cloud architectural patterns and Microsoft Azure toolsPushkar Chivate
 
Using Elasticsearch for Analytics
Using Elasticsearch for AnalyticsUsing Elasticsearch for Analytics
Using Elasticsearch for AnalyticsVaidik Kapoor
 
The Ultimate Logging Architecture - You KNOW you want it!
The Ultimate Logging Architecture - You KNOW you want it!The Ultimate Logging Architecture - You KNOW you want it!
The Ultimate Logging Architecture - You KNOW you want it!Michele Leroux Bustamante
 
Rev Your Engines - SharePoint Performance Best Practices
Rev Your Engines - SharePoint Performance Best PracticesRev Your Engines - SharePoint Performance Best Practices
Rev Your Engines - SharePoint Performance Best PracticesEric Shupps
 
SPTECHCON - Rev Your Engines - SharePoint 2013 Performance Enhancements
SPTECHCON - Rev Your Engines - SharePoint 2013 Performance EnhancementsSPTECHCON - Rev Your Engines - SharePoint 2013 Performance Enhancements
SPTECHCON - Rev Your Engines - SharePoint 2013 Performance EnhancementsEric Shupps
 
02 integrate highchart
02 integrate highchart02 integrate highchart
02 integrate highchartErhwen Kuo
 
Dropping ACID: Wrapping Your Mind Around NoSQL Databases
Dropping ACID: Wrapping Your Mind Around NoSQL DatabasesDropping ACID: Wrapping Your Mind Around NoSQL Databases
Dropping ACID: Wrapping Your Mind Around NoSQL DatabasesKyle Banerjee
 
RavenDB - Indexes Deep Dive
RavenDB - Indexes Deep DiveRavenDB - Indexes Deep Dive
RavenDB - Indexes Deep DiveAlonso Robles
 
SQL PASS BAC - 60 reporting tips in 60 minutes
SQL PASS BAC - 60 reporting tips in 60 minutesSQL PASS BAC - 60 reporting tips in 60 minutes
SQL PASS BAC - 60 reporting tips in 60 minutesIke Ellis
 
Zapping ever faster: how Zap sped up by two orders of magnitude using RavenDB
Zapping ever faster: how Zap sped up by two orders of magnitude using RavenDBZapping ever faster: how Zap sped up by two orders of magnitude using RavenDB
Zapping ever faster: how Zap sped up by two orders of magnitude using RavenDBOren Eini
 
Search UI and Lucidworks View: Presented by Josh Ellinger, Lucidworks
Search UI and Lucidworks View: Presented by Josh Ellinger, LucidworksSearch UI and Lucidworks View: Presented by Josh Ellinger, Lucidworks
Search UI and Lucidworks View: Presented by Josh Ellinger, LucidworksLucidworks
 
ECS19 - Marco Rocca and Fabio Franzini - Need a custom logic in PowerApps? Us...
ECS19 - Marco Rocca and Fabio Franzini - Need a custom logic in PowerApps? Us...ECS19 - Marco Rocca and Fabio Franzini - Need a custom logic in PowerApps? Us...
ECS19 - Marco Rocca and Fabio Franzini - Need a custom logic in PowerApps? Us...European Collaboration Summit
 

Was ist angesagt? (20)

Lessons from the Trenches - Building Enterprise Applications with RavenDB
Lessons from the Trenches - Building Enterprise Applications with RavenDBLessons from the Trenches - Building Enterprise Applications with RavenDB
Lessons from the Trenches - Building Enterprise Applications with RavenDB
 
Command Query Responsibility Segregation (CQRS)
Command Query Responsibility Segregation (CQRS)Command Query Responsibility Segregation (CQRS)
Command Query Responsibility Segregation (CQRS)
 
Rev Your Engines: SharePoint Performance Best Practices
Rev Your Engines: SharePoint Performance Best PracticesRev Your Engines: SharePoint Performance Best Practices
Rev Your Engines: SharePoint Performance Best Practices
 
Building Codealike: a journey into the developers analytics world
Building Codealike: a journey into the developers analytics worldBuilding Codealike: a journey into the developers analytics world
Building Codealike: a journey into the developers analytics world
 
Azure CosmosDB the new frontier of big data and nosql
Azure CosmosDB the new frontier of big data and nosqlAzure CosmosDB the new frontier of big data and nosql
Azure CosmosDB the new frontier of big data and nosql
 
Elastic & Azure & Episever, Case Evira
Elastic & Azure & Episever, Case EviraElastic & Azure & Episever, Case Evira
Elastic & Azure & Episever, Case Evira
 
Episerver and search engines
Episerver and search enginesEpiserver and search engines
Episerver and search engines
 
Cloud architectural patterns and Microsoft Azure tools
Cloud architectural patterns and Microsoft Azure toolsCloud architectural patterns and Microsoft Azure tools
Cloud architectural patterns and Microsoft Azure tools
 
Using Elasticsearch for Analytics
Using Elasticsearch for AnalyticsUsing Elasticsearch for Analytics
Using Elasticsearch for Analytics
 
The Ultimate Logging Architecture - You KNOW you want it!
The Ultimate Logging Architecture - You KNOW you want it!The Ultimate Logging Architecture - You KNOW you want it!
The Ultimate Logging Architecture - You KNOW you want it!
 
Rev Your Engines - SharePoint Performance Best Practices
Rev Your Engines - SharePoint Performance Best PracticesRev Your Engines - SharePoint Performance Best Practices
Rev Your Engines - SharePoint Performance Best Practices
 
SPTECHCON - Rev Your Engines - SharePoint 2013 Performance Enhancements
SPTECHCON - Rev Your Engines - SharePoint 2013 Performance EnhancementsSPTECHCON - Rev Your Engines - SharePoint 2013 Performance Enhancements
SPTECHCON - Rev Your Engines - SharePoint 2013 Performance Enhancements
 
02 integrate highchart
02 integrate highchart02 integrate highchart
02 integrate highchart
 
Dropping ACID: Wrapping Your Mind Around NoSQL Databases
Dropping ACID: Wrapping Your Mind Around NoSQL DatabasesDropping ACID: Wrapping Your Mind Around NoSQL Databases
Dropping ACID: Wrapping Your Mind Around NoSQL Databases
 
RavenDB - Indexes Deep Dive
RavenDB - Indexes Deep DiveRavenDB - Indexes Deep Dive
RavenDB - Indexes Deep Dive
 
Elasticsearch 5.0
Elasticsearch 5.0Elasticsearch 5.0
Elasticsearch 5.0
 
SQL PASS BAC - 60 reporting tips in 60 minutes
SQL PASS BAC - 60 reporting tips in 60 minutesSQL PASS BAC - 60 reporting tips in 60 minutes
SQL PASS BAC - 60 reporting tips in 60 minutes
 
Zapping ever faster: how Zap sped up by two orders of magnitude using RavenDB
Zapping ever faster: how Zap sped up by two orders of magnitude using RavenDBZapping ever faster: how Zap sped up by two orders of magnitude using RavenDB
Zapping ever faster: how Zap sped up by two orders of magnitude using RavenDB
 
Search UI and Lucidworks View: Presented by Josh Ellinger, Lucidworks
Search UI and Lucidworks View: Presented by Josh Ellinger, LucidworksSearch UI and Lucidworks View: Presented by Josh Ellinger, Lucidworks
Search UI and Lucidworks View: Presented by Josh Ellinger, Lucidworks
 
ECS19 - Marco Rocca and Fabio Franzini - Need a custom logic in PowerApps? Us...
ECS19 - Marco Rocca and Fabio Franzini - Need a custom logic in PowerApps? Us...ECS19 - Marco Rocca and Fabio Franzini - Need a custom logic in PowerApps? Us...
ECS19 - Marco Rocca and Fabio Franzini - Need a custom logic in PowerApps? Us...
 

Andere mochten auch

Azure DocumentDB: Advanced Features for Large Scale-Apps
Azure DocumentDB: Advanced Features for Large Scale-AppsAzure DocumentDB: Advanced Features for Large Scale-Apps
Azure DocumentDB: Advanced Features for Large Scale-AppsAndrew Liu
 
[PASS Summit 2016] Azure DocumentDB: A Deep Dive into Advanced Features
[PASS Summit 2016] Azure DocumentDB: A Deep Dive into Advanced Features[PASS Summit 2016] Azure DocumentDB: A Deep Dive into Advanced Features
[PASS Summit 2016] Azure DocumentDB: A Deep Dive into Advanced FeaturesAndrew Liu
 
[PASS Summit 2016] Blazing Fast, Planet-Scale Customer Scenarios with Azure D...
[PASS Summit 2016] Blazing Fast, Planet-Scale Customer Scenarios with Azure D...[PASS Summit 2016] Blazing Fast, Planet-Scale Customer Scenarios with Azure D...
[PASS Summit 2016] Blazing Fast, Planet-Scale Customer Scenarios with Azure D...Andrew Liu
 
SQL Server vs. Azure DocumentDB – Ein Battle zwischen XML und JSON
SQL Server vs. Azure DocumentDB – Ein Battle zwischen XML und JSONSQL Server vs. Azure DocumentDB – Ein Battle zwischen XML und JSON
SQL Server vs. Azure DocumentDB – Ein Battle zwischen XML und JSONSascha Dittmann
 
Deep-Dive to Azure Search
Deep-Dive to Azure SearchDeep-Dive to Azure Search
Deep-Dive to Azure SearchGunnar Peipman
 
Azure DocumentDB Overview
Azure DocumentDB OverviewAzure DocumentDB Overview
Azure DocumentDB OverviewAndrew Liu
 
Azure Media Services & Azure Search
Azure Media Services & Azure SearchAzure Media Services & Azure Search
Azure Media Services & Azure SearchEmanuele Bartolesi
 
Introducing Azure DocumentDB - NoSQL, No Problem
Introducing Azure DocumentDB - NoSQL, No ProblemIntroducing Azure DocumentDB - NoSQL, No Problem
Introducing Azure DocumentDB - NoSQL, No ProblemAndrew Liu
 

Andere mochten auch (9)

Azure DocumentDB: Advanced Features for Large Scale-Apps
Azure DocumentDB: Advanced Features for Large Scale-AppsAzure DocumentDB: Advanced Features for Large Scale-Apps
Azure DocumentDB: Advanced Features for Large Scale-Apps
 
[PASS Summit 2016] Azure DocumentDB: A Deep Dive into Advanced Features
[PASS Summit 2016] Azure DocumentDB: A Deep Dive into Advanced Features[PASS Summit 2016] Azure DocumentDB: A Deep Dive into Advanced Features
[PASS Summit 2016] Azure DocumentDB: A Deep Dive into Advanced Features
 
[PASS Summit 2016] Blazing Fast, Planet-Scale Customer Scenarios with Azure D...
[PASS Summit 2016] Blazing Fast, Planet-Scale Customer Scenarios with Azure D...[PASS Summit 2016] Blazing Fast, Planet-Scale Customer Scenarios with Azure D...
[PASS Summit 2016] Blazing Fast, Planet-Scale Customer Scenarios with Azure D...
 
SQL Server vs. Azure DocumentDB – Ein Battle zwischen XML und JSON
SQL Server vs. Azure DocumentDB – Ein Battle zwischen XML und JSONSQL Server vs. Azure DocumentDB – Ein Battle zwischen XML und JSON
SQL Server vs. Azure DocumentDB – Ein Battle zwischen XML und JSON
 
Deep-Dive to Azure Search
Deep-Dive to Azure SearchDeep-Dive to Azure Search
Deep-Dive to Azure Search
 
Azure DocumentDB Overview
Azure DocumentDB OverviewAzure DocumentDB Overview
Azure DocumentDB Overview
 
Azure Media Services & Azure Search
Azure Media Services & Azure SearchAzure Media Services & Azure Search
Azure Media Services & Azure Search
 
Azure DocumentDb
Azure DocumentDbAzure DocumentDb
Azure DocumentDb
 
Introducing Azure DocumentDB - NoSQL, No Problem
Introducing Azure DocumentDB - NoSQL, No ProblemIntroducing Azure DocumentDB - NoSQL, No Problem
Introducing Azure DocumentDB - NoSQL, No Problem
 

Ähnlich wie Test driving Azure Search and DocumentDB

An Introduction to Elastic Search.
An Introduction to Elastic Search.An Introduction to Elastic Search.
An Introduction to Elastic Search.Jurriaan Persyn
 
Microsoft Azure DocumentDB - Global Azure Bootcamp 2016
Microsoft Azure DocumentDB -  Global Azure Bootcamp 2016Microsoft Azure DocumentDB -  Global Azure Bootcamp 2016
Microsoft Azure DocumentDB - Global Azure Bootcamp 2016Sunny Sharma
 
Scaling the Web: Databases & NoSQL
Scaling the Web: Databases & NoSQLScaling the Web: Databases & NoSQL
Scaling the Web: Databases & NoSQLRichard Schneeman
 
TechEd AU 2014: Microsoft Azure DocumentDB Deep Dive
TechEd AU 2014: Microsoft Azure DocumentDB Deep DiveTechEd AU 2014: Microsoft Azure DocumentDB Deep Dive
TechEd AU 2014: Microsoft Azure DocumentDB Deep DiveIntergen
 
Where Is My Data - ILTAM Session
Where Is My Data - ILTAM SessionWhere Is My Data - ILTAM Session
Where Is My Data - ILTAM SessionTamir Dresher
 
SharePoint 2013 Search Based Solutions
SharePoint 2013 Search Based SolutionsSharePoint 2013 Search Based Solutions
SharePoint 2013 Search Based SolutionsSPC Adriatics
 
Developing Search-driven application in SharePoint 2013
 Developing Search-driven application in SharePoint 2013  Developing Search-driven application in SharePoint 2013
Developing Search-driven application in SharePoint 2013 SPC Adriatics
 
Data Modeling for NoSQL
Data Modeling for NoSQLData Modeling for NoSQL
Data Modeling for NoSQLTony Tam
 
Boost the Performance of SharePoint Today!
Boost the Performance of SharePoint Today!Boost the Performance of SharePoint Today!
Boost the Performance of SharePoint Today!Brian Culver
 
Getting started with Laravel & Elasticsearch
Getting started with Laravel & ElasticsearchGetting started with Laravel & Elasticsearch
Getting started with Laravel & ElasticsearchPeter Steenbergen
 
Dev nexus 2017
Dev nexus 2017Dev nexus 2017
Dev nexus 2017Roy Russo
 
Full Text Search with Lucene
Full Text Search with LuceneFull Text Search with Lucene
Full Text Search with LuceneWO Community
 
Build a modern data platform.pptx
Build a modern data platform.pptxBuild a modern data platform.pptx
Build a modern data platform.pptxIke Ellis
 
ElasticSearch: Distributed Multitenant NoSQL Datastore and Search Engine
ElasticSearch: Distributed Multitenant NoSQL Datastore and Search EngineElasticSearch: Distributed Multitenant NoSQL Datastore and Search Engine
ElasticSearch: Distributed Multitenant NoSQL Datastore and Search EngineDaniel N
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDBSean Laurent
 

Ähnlich wie Test driving Azure Search and DocumentDB (20)

An Introduction to Elastic Search.
An Introduction to Elastic Search.An Introduction to Elastic Search.
An Introduction to Elastic Search.
 
Microsoft Azure DocumentDB - Global Azure Bootcamp 2016
Microsoft Azure DocumentDB -  Global Azure Bootcamp 2016Microsoft Azure DocumentDB -  Global Azure Bootcamp 2016
Microsoft Azure DocumentDB - Global Azure Bootcamp 2016
 
Scaling the Web: Databases & NoSQL
Scaling the Web: Databases & NoSQLScaling the Web: Databases & NoSQL
Scaling the Web: Databases & NoSQL
 
Mongo DB
Mongo DB Mongo DB
Mongo DB
 
No sql Database
No sql DatabaseNo sql Database
No sql Database
 
TechEd AU 2014: Microsoft Azure DocumentDB Deep Dive
TechEd AU 2014: Microsoft Azure DocumentDB Deep DiveTechEd AU 2014: Microsoft Azure DocumentDB Deep Dive
TechEd AU 2014: Microsoft Azure DocumentDB Deep Dive
 
Where Is My Data - ILTAM Session
Where Is My Data - ILTAM SessionWhere Is My Data - ILTAM Session
Where Is My Data - ILTAM Session
 
SharePoint 2013 Search Based Solutions
SharePoint 2013 Search Based SolutionsSharePoint 2013 Search Based Solutions
SharePoint 2013 Search Based Solutions
 
Developing Search-driven application in SharePoint 2013
 Developing Search-driven application in SharePoint 2013  Developing Search-driven application in SharePoint 2013
Developing Search-driven application in SharePoint 2013
 
Data Modeling for NoSQL
Data Modeling for NoSQLData Modeling for NoSQL
Data Modeling for NoSQL
 
Boost the Performance of SharePoint Today!
Boost the Performance of SharePoint Today!Boost the Performance of SharePoint Today!
Boost the Performance of SharePoint Today!
 
Getting started with Laravel & Elasticsearch
Getting started with Laravel & ElasticsearchGetting started with Laravel & Elasticsearch
Getting started with Laravel & Elasticsearch
 
Dev nexus 2017
Dev nexus 2017Dev nexus 2017
Dev nexus 2017
 
How Solr Search Works
How Solr Search WorksHow Solr Search Works
How Solr Search Works
 
Full Text Search with Lucene
Full Text Search with LuceneFull Text Search with Lucene
Full Text Search with Lucene
 
MongoDB Basics
MongoDB BasicsMongoDB Basics
MongoDB Basics
 
Build a modern data platform.pptx
Build a modern data platform.pptxBuild a modern data platform.pptx
Build a modern data platform.pptx
 
CosmosDB.pptx
CosmosDB.pptxCosmosDB.pptx
CosmosDB.pptx
 
ElasticSearch: Distributed Multitenant NoSQL Datastore and Search Engine
ElasticSearch: Distributed Multitenant NoSQL Datastore and Search EngineElasticSearch: Distributed Multitenant NoSQL Datastore and Search Engine
ElasticSearch: Distributed Multitenant NoSQL Datastore and Search Engine
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 

Mehr von Andrew Siemer

20 tips for website performance
20 tips for website performance20 tips for website performance
20 tips for website performanceAndrew Siemer
 
Microservices pros and cons - houston tech fest
Microservices pros and cons - houston tech festMicroservices pros and cons - houston tech fest
Microservices pros and cons - houston tech festAndrew Siemer
 
Microservices pros and cons dark
Microservices pros and cons darkMicroservices pros and cons dark
Microservices pros and cons darkAndrew Siemer
 
Microservices pros and cons
Microservices pros and consMicroservices pros and cons
Microservices pros and consAndrew Siemer
 
Reigniting the Volusion platform
Reigniting the Volusion platformReigniting the Volusion platform
Reigniting the Volusion platformAndrew Siemer
 
Grokking microservices in 5 minutes
Grokking microservices in 5 minutesGrokking microservices in 5 minutes
Grokking microservices in 5 minutesAndrew Siemer
 
Making your API behave like a big boy
Making your API behave like a big boyMaking your API behave like a big boy
Making your API behave like a big boyAndrew Siemer
 
Load testing with Visual Studio and Azure - Andrew Siemer
Load testing with Visual Studio and Azure - Andrew SiemerLoad testing with Visual Studio and Azure - Andrew Siemer
Load testing with Visual Studio and Azure - Andrew SiemerAndrew Siemer
 
A tale of two clouds
A tale of two cloudsA tale of two clouds
A tale of two cloudsAndrew Siemer
 
Introduction to CQRS - command and query responsibility segregation
Introduction to CQRS - command and query responsibility segregationIntroduction to CQRS - command and query responsibility segregation
Introduction to CQRS - command and query responsibility segregationAndrew Siemer
 

Mehr von Andrew Siemer (10)

20 tips for website performance
20 tips for website performance20 tips for website performance
20 tips for website performance
 
Microservices pros and cons - houston tech fest
Microservices pros and cons - houston tech festMicroservices pros and cons - houston tech fest
Microservices pros and cons - houston tech fest
 
Microservices pros and cons dark
Microservices pros and cons darkMicroservices pros and cons dark
Microservices pros and cons dark
 
Microservices pros and cons
Microservices pros and consMicroservices pros and cons
Microservices pros and cons
 
Reigniting the Volusion platform
Reigniting the Volusion platformReigniting the Volusion platform
Reigniting the Volusion platform
 
Grokking microservices in 5 minutes
Grokking microservices in 5 minutesGrokking microservices in 5 minutes
Grokking microservices in 5 minutes
 
Making your API behave like a big boy
Making your API behave like a big boyMaking your API behave like a big boy
Making your API behave like a big boy
 
Load testing with Visual Studio and Azure - Andrew Siemer
Load testing with Visual Studio and Azure - Andrew SiemerLoad testing with Visual Studio and Azure - Andrew Siemer
Load testing with Visual Studio and Azure - Andrew Siemer
 
A tale of two clouds
A tale of two cloudsA tale of two clouds
A tale of two clouds
 
Introduction to CQRS - command and query responsibility segregation
Introduction to CQRS - command and query responsibility segregationIntroduction to CQRS - command and query responsibility segregation
Introduction to CQRS - command and query responsibility segregation
 

Kürzlich hochgeladen

A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecturerahul_net
 
VictoriaMetrics Anomaly Detection Updates: Q1 2024
VictoriaMetrics Anomaly Detection Updates: Q1 2024VictoriaMetrics Anomaly Detection Updates: Q1 2024
VictoriaMetrics Anomaly Detection Updates: Q1 2024VictoriaMetrics
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf31events.com
 
Patterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencePatterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencessuser9e7c64
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?Alexandre Beguel
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...OnePlan Solutions
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Rob Geurden
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorTier1 app
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingOpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingShane Coughlan
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonApplitools
 
Introduction to Firebase Workshop Slides
Introduction to Firebase Workshop SlidesIntroduction to Firebase Workshop Slides
Introduction to Firebase Workshop Slidesvaideheekore1
 
SoftTeco - Software Development Company Profile
SoftTeco - Software Development Company ProfileSoftTeco - Software Development Company Profile
SoftTeco - Software Development Company Profileakrivarotava
 

Kürzlich hochgeladen (20)

A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecture
 
VictoriaMetrics Anomaly Detection Updates: Q1 2024
VictoriaMetrics Anomaly Detection Updates: Q1 2024VictoriaMetrics Anomaly Detection Updates: Q1 2024
VictoriaMetrics Anomaly Detection Updates: Q1 2024
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
 
Patterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencePatterns for automating API delivery. API conference
Patterns for automating API delivery. API conference
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryError
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingOpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
 
Introduction to Firebase Workshop Slides
Introduction to Firebase Workshop SlidesIntroduction to Firebase Workshop Slides
Introduction to Firebase Workshop Slides
 
SoftTeco - Software Development Company Profile
SoftTeco - Software Development Company ProfileSoftTeco - Software Development Company Profile
SoftTeco - Software Development Company Profile
 

Test driving Azure Search and DocumentDB

  • 1. Test driving Azure Search and DocumentDB Andrew Siemer | Clear Measure andrew@clear-measure.com @asiemer
  • 2. Andrew Siemer http://about.me/andrewsiemer ASP Insider MS v-TSP (Azure) Azure Advisor Program Father of 6. Jack of all trades, master of some.
  • 3.
  • 4. Writing a book on Azure • LeanPub • GitHub • Written in the open • Want to help?
  • 5.  We are hiring!!!
  • 7. Introduction • DocumentDB • Azure Search • Where might you use each?
  • 10. When is NoSQL better than N • Unstructured data • Favors data that is immediately related • Denormalized (or flat) data • Need easy scaling options – distributed by default (add nodes) • When you don’t need transactions across collections
  • 11. When not to use NoSQL • Need to do heavy joins across collections • When many to many query depth is unknown • User has a collection of users (friends) which have a collection of users
  • 13. What is search? • Indexes • Documents • Fields • Types of searchability • Retrievable • Non-retrievable • Tokenization • Facets • Scoring
  • 14. When to use search • Need an easy way to score results • Fuzzy searching is easy • Finely control results around business rules • Ability to boost newer results • Built around distributed first (over SOLR, others)
  • 15. When not to use search • Large computational work • Need real time data access • Small budget AND high availability
  • 17. Example site: jeep listings • Listings contain: • A picture of a Jeep • Various jeep options • Dealer information • Price info
  • 18. Example site: jeep listings
  • 19.
  • 22. How to set up DocumentDB
  • 23. Let’s create a new Document DB • …is Azure up and available?
  • 24. DocumentDB high points • Has a Microsoft provided SDK via Nuget • Uses auth key for security • Everything is based on a capacity unit • Up to 5 capacity units available for preview • 10GB per capacity unit • 2000 requests per second • $.73/day ($22.50 per month) • Average operations per second per capacity unit • Based on simple structure • 2000 read of a single document • 500 inserts, replaces, or deletes • 1000 queries returning a single document
  • 25. Elastic SSD • Makes collection truly elastic • Add/Remove documents grows/shrinks collection • Tested with real-world clients from gigabytes to terrabytes
  • 26. Automatic Indexing • Indexing on by default • Can optimize for performance and storage tradeoffs • Index only specific paths in your document • Synchronous indexing at write time by default • Can be Asynchronous for boosted write performance • Eventually consistent
  • 27. Document Explorer • There is a tool to manage docs • Not terribly useful! • …yet
  • 29.
  • 31. Structure: Database • The container that houses your data • /db/{id} is not your ID • Hash known as a “Self Link”
  • 32. Structure: Media • Video • Audio • Blob • Etc.
  • 33. Structure: User • Invite in an existing azure account • Allows you to set permissions on each concept of the database
  • 34. Structure: Permission • Authorization token • Associated with a user • Grants access to a given resource
  • 35. Structure: Collection • Most like a “table” • Structure is not defined • Dynamic shapes based on what you put in it
  • 36. Structure: Document • A blob of JSON representing your data • Can be a deeply nested shape • No specialty types • No specific encoding types
  • 37. Structure: Attachment • Think media – at the document level!
  • 38. Structure: Stored Procedure • Written in javascript! • Is transactional • Executed by the database engine • Can live in the store • Can be sent over the wire
  • 39.
  • 40. Structure: Triggers • Can be Pre or Post (before or after) • Can operate on the following actions • Create • Replace • Delete • All • Also written in javascript!
  • 41. Structure: UDF • Can only be ran on a query • Modifies the result of a given query • mathSqrt()
  • 42.
  • 43. Create a document store • Everything is done asynchronously! • The ID of a new database is the friendly name database = await GetClient().CreateDatabaseAsync(new Database { Id = id });
  • 44. Adding data • Since DocumentDB is dynamic you just throw data in await client.CreateDocumentAsync(documentCollection.SelfLink, listing);
  • 45. Batch operations • Not necessarily a built in operation • Can be done with a stored procedure that takes a collection of documents (JSON)
  • 46. Querying • Everything is done asynchronously in the SDK • The ID of a new database is the friendly name • Everything references the “SelfLink” • This is the internal ID of the resource you are working with • Used to build up the API call http://azure.microsoft.com/en-us/documentation/articles/documentdb-sql-query/
  • 47. Querying: Simple • SELECT * FROM var client = GetClient(); var collection = await GetCollection(client, Keys.ListingsDbName, Keys.ListingDbCollectionName); string sql = String.Format("SELECT * FROM {0}", Keys.ListingDbCollectionName); var jeepsQuery = client.CreateDocumentQuery<Listing>(collection.SelfLink, sql).ToArray(); var jeeps = jeepsQuery.ToArray();
  • 48. Querying: More complex • Joining requires the shape to be specified var client = GetClient(); var collection = await GetCollection(client, Keys.ListingsDbName, Keys.ListingDbCollectionName); string sql = String.Format(@"SELECT l.Color, l.Options, l.Package, l.Type, l.Image, l.Dealer, l.Id FROM {0} l JOIN o IN l.Options WHERE o.Name = 'hard top'", Keys.ListingDbCollectionName); var hardtopQuery = client.CreateDocumentQuery<Listing>(collection.SelfLink, sql).ToArray();
  • 49. REST API • Everything is done via a REST call! Create data request Query data request
  • 50. Interactive query demo online • Microsoft has provided an interactive demo for you to play with • http://www.documentdb.com/sql/demo
  • 51.
  • 54. What is search? You mean “where [field] like ‘%query%’” isn’t a search engine? NOPE!!!!
  • 55. What is search? • Indexes • Documents • Fields • Types of searchability • Retrievable • Non-retrievable • Tokenization • Facets • Scoring
  • 56. What is Azure Search Preview? • Hosted • High performance • Horizontally scalable • Elastic Search under the covers
  • 57. Concerns with the preview? • English only • No additional tokenization strategies • Standard: treats white space and punctuation as delimiters • Keyword: treats entire string as a token • Fixed fields (can’t remove) • No document level security
  • 58. Setting up Azure Search Creating a search instance
  • 59. Azure Search Options • “Standard” can be scaled based on workload • “Shared” is free and solely for testing (no perf guarantees) • REST API access only – no SDK from Microsoft yet • RedDog.Search is available on Nuget • Security is limited to API key
  • 60. Quick specs What Free Standard Size 50mb 25gb per unit Queries per second N/A 15 per unit Number of documents 10,000 across 3 indexes 15M per unit, 50 index limit Scale out limits N/A Up to 36 units Price Free $.168/hour, $125/month
  • 61. Understanding “units” More replicas equals more performance More partitions equals more documents and more space • 1 replica + 1 partition = 1 search unit • 6 replicas + 1 partition = (1 replica & 1 partition) + 5 replicas = 6 search units • 2 replicas + 2 partitions = (1 replica & 1 partition) + (1 replica & 1 partition) = 2 search units
  • 62. No SDK yet! • RedDog.Search • Provided via Nuget and on GitHub • Also all asynchronous • AdventureWorksCatalog – sample code • Great example of composing REST requests • http://azure.microsoft.com/en-us/documentation/articles/search-create-first- solution/
  • 63. Azure Search is structured • A search index has a predefined structure • It is not dynamic • Each field in the index has characteristics defined when created • Filterable? • Searchable? • Faceted? • Retrievable? • Sortable?
  • 64. Field Characteristics: Key • Required! • Can only be on one field for the document • Can be used to look up a document directly • Update • Delete
  • 65. Field Characteristics: Searchable • Makes the field full-text-search-able • Breaks the words of the field for indexing purposes • “Big Red Jeep” will become separate components • A search for “big”, “red”, “jeep”, or “big jeep” will hit this record • Other field types are not searchable! • Searchable fields cause bloat! • Only make it searchable if it needs to be
  • 66. Field Characteristics: Filterable • Doesn’t under go word breaking • Exact matches only • Only searches for “big red jeep” will hit a “big red jeep” record • All fields are filterable by default
  • 67. Field Characteristics: Sortable • By default, results are sorted by score • Strings are not sortable! • All other types are sortable by default
  • 68. Field Characteristics: Facetable • Geography points are not facetable • All other fields are facetable by default • Used to rank records by other notions • Jeeps that sold by this {dealer} • Jeeps that are this {color}
  • 69. Field Characteristics: Suggestions • Used for auto-complete • Only for string or collection of string • False by default • Causes bloat in the index!
  • 70. Field Characteristics: Retrievable • Allows the field to be returned in the search results • Key fields must be retrievable
  • 71. Field Characteristics: can be false • If turning a feature on expands the index… • only turn it one when you intend to use it! "filterable": false, "sortable": false, "facetable": false, "suggestions": false
  • 72. Creating an index var newIndex = new Index(Keys.ListingsServiceIndexName) .WithStringField("Id", opt => opt.IsKey().IsRetrievable()) .WithStringField("Color", opt => opt.IsSearchable() .IsSortable() .IsFilterable() .IsRetrievable() .IsFacetable()) .WithStringField("Package", opt => opt.IsSearchable() .IsFilterable() .IsRetrievable() .IsFacetable()) ... index = await managementClient.CreateIndexAsync(newIndex);
  • 73. Index naming • I found this out the hard way …index names must be all lower case, digits, or dashes – 128 character max
  • 74. Scoring Profiles • Gives you greater control over the results • Control over boosting documents based on freshness • Distance allows you to boost documents that are “closer” • Based on geographic location • Magnitude scoring alters ranking based on a range of values • Highest rated • Produces the highest margin
  • 75. Interpolations • Slope at which boosting increases from range start to end • Linear – constant decreasing amount • Default • Constant – constant boost is applied • Quadratic – slow to fast boost drop off • Logarithmic – fast to slow boost drop off
  • 77. Adding a scoring profile • Can be added to the index at any time var sp = new ScoringProfile(); sp.Name = "ByTypeAndPackage"; sp.Text = new ScoringProfileText(); sp.Text.Weights = new Dictionary<string, double>(); sp.Text.Weights.Add("Type", 1.5); sp.Text.Weights.Add("Package", 1.5); newIndex.ScoringProfiles.Add(sp);
  • 78. Adding data to the index • Need to map your object to your index var op = new IndexOperation(IndexOperationType.Upload, "Id", l.Id.ToString()) .WithProperty("Color", l.Color) .WithProperty("Options", flatOptions) .WithProperty("Package", l.Package) .WithProperty("Type", l.Type) .WithProperty("Image", l.Image); operations.Add(op); var result = await managementClient.PopulateAsync(Keys.ListingsServiceIndexName, operations.ToArray());
  • 79. Batch operations • The previous code was a batch operation • You can batch up to 1000 “operations” in one call • Can be any operation in the batch • Adds • Deletes • Updates
  • 80. Querying the index • Have to specify what fields you want returned • Can only output retrievable fields var conn = ApiConnection.Create(Keys.ListingsServiceUrl, Keys.ListingsServiceKey); var queryClient = new IndexQueryClient(conn); var query = new SearchQuery(search) .Count(true) .Select("Id,Color,Options,Type,Package,Image") .OrderBy("Color"); var searchResults = await queryClient.SearchAsync(Keys.ListingsServiceIndexName, query);
  • 82. Where might I use them?
  • 83. Where does it fit? Client Web API queue Service Event Store nosql Saga Storage nosql queue Service nosql relational warehouse reporting site Admin site search search NOSQL SEARCH
  • 84. Where does it fit? Client Web API queue Service Event Store nosql Saga Storage nosql queue Service nosql relational warehouse reporting site Admin site search search NOSQL SEARCH CQRS Event Store Saga persistence Denormalized view data
  • 85. Where does it fit? Client Web API queue Service Event Store nosql Saga Storage nosql queue Service nosql relational warehouse reporting site Admin site search search NOSQL SEARCH Search first navigation Data/Decision enrichment
  • 87. Questions? Andrew Siemer Clear Measure andrew@clear-measure.com (512) 387-1976 @asiemer Code and slides: https://github.com/asiemer/AzureJeeps You can find me here: http://www.andrewsiemer.com http://www.siemerforhire.com http://about.me/AndrewSiemer AzureAustin http://www.meetup.com/AzureAustin

Hinweis der Redaktion

  1. Andrew Siemer, I am an ASP Insider, Microsoft virtual technology specialist program, father of 6, and general jack of all trades – master of some! I enjoy all things texas, obstacle racing, cowboying, and playing with my six kids
  2. Some books I have written or am writing
  3. We are starting an Azure book. Written in the open on LeanPub and GitHub. Want to help?
  4. Some places I have worked and some projects I have worked on
  5. Let’s quickly look at how we can set up and configure a DocumentDB
  6. In case the internet is down, some screen shot quick steps for setting up a documentdb
  7. Now let’s jump out to Azure and see if we can actually create a new documentdb
  8. All the marketing specs around DocumentDB. Everything is capacity unit based. Speed specs assume simple document structure.
  9. http://azure.microsoft.com/en-us/documentation/articles/documentdb-interactions-with-resources/
  10. Added to scoring profiles