SlideShare a Scribd company logo
1 of 32
Learning How to Shape and Configure an
OData Feed for High Performing Web
Sites and Applications
PRAIRIE DEVCON
CHRIS WOODRUFF
Hi, I’m Woody!
• Chris Woodruff
• cwoodruff@live.com
• http://chriswoodruff.com
• http://deepfriedbytes.com
• twitter @cwoodruff
VALIDATION CLIENT SIDEBEST PRACTICES
AGENDA
What are the 2 Sides of OData?
SERVER-SIDE (PRODUCER) CLIENT-SIDE (CONSUMER)
Server Side for OData
UNDERSTAND REST
The Top Reasons You Need to Learn about Data in Your Windows Phone App
WHAT IS REST?
RESOURCES
VERBS
URL
WHAT SHOULD YOU KNOW ABOUT REST?
Resources
REST uses addressable resources to define the
structure of the API. These are the URLs you use to
get to pages on the web
Request Headers
These are additional instructions that are sent with the
request. These might define what type of response is
required or authorization details.
Request Verbs
These describe what you want to do with the resource.
A browser typically issues a GET verb to instruct the
endpoint it wants to get data, however there are many
other verbs available including things like POST, PUT
and DELETE.
Request Body
Data that is sent with the request. For example a
POST (creation of a new item) will required some data
which is typically sent as the request body in the format
of JSON or XML.
Response Body
This is the main body of the response. If the request
was to a web server, this might be a full HTML page, if
it was to an API, this might be a JSON or XML
document.
Response Status codes
These codes are issues with the response and give
the client details on the status of the request.
REST & HTTP VERBS
GET
Requests a representation of the specified
Requests using GET should only retrieve
have no other effect.
POST
Requests that the server accept the entity
enclosed in the request as a new
subordinate of the web resource identified
by the URI.
PUT
Requests that the enclosed entity be stored
under the supplied URI.
DELETE
Deletes the specified resource.
EXAMPLES OF REST AND ODATA
/Products
RESOURCE EXPECTED OUTCOMEVERB RESPONSE CODE
/Products?$filter=Color eq ‘Red'
/Products
/Products(81)
/Products(881)
/Products(81)
/Products(81)
GET
GET
POST
GET
GET
PUT
DELETE
A list of all products in the system
A list of all products in the system
where the color is red
Creation of a new product
Product with an ID of 81
Some error message
Update of the product with ID of 81
Deletion of the product with ID of
81
200/OK
200/OK
201/Created
200/OK
404/Not Found
204/No Content
204/No Content
BEST PRACTICES
Get to know the OData Protocol!!!
Query Projection
Server Side Paging
Configuration Settings
VALIDATION AND FILTERING
QUERYABLE ODATAATTRIBUTES
AllowedFunctions
Consider disabling the any() and all() functions, as these can be
0
5
IgnoreDataMember (not with
Queryable)
Represents an Attribute that can be placed on a property to specify
that the property cannot be navigated in OData query.
0
6
PageSize
Enable server-driven paging, to avoid returning a large data set in
one query. For more information
0
1
AllowedQueryOptions
Do you need $filter and $orderby? Some applications might allow
client paging, using $top and $skip, but disable the other query
options.
0
2
AllowedOrderByProperties
Consider restricting $orderby to properties in a clustered index.
Sorting large data without a clustered index is slow.
0
3
MaxNodeCount
The MaxNodeCount property on [Queryable] sets the maximum
number nodes allowed in the $filter syntax tree. The default value
is 100, but you may want to set a lower value, because a large
number of nodes can be slow to compile. This is particularly true if
you are using LINQ to Objects
0
4
ODATAATTRIBUTES (CONT)
NotExpandable
Represents an Attribute that can be placed on a property to specify
be used in the $expand OData query option.
0
5
NotNavigable
Represents an Attribute that can be placed on a property to specify
that the property cannot be navigated in OData query.
0
6
NotSortable
Represents an attribute that can be placed on a property to specify
that the property cannot be used in the $orderby OData query
option.
0
7
NonFilterable
Represents an Attribute that can be placed on a property to specify
that the property cannot be used in the $filter OData query option.
0
1
UnSortable
Represents an Attribute that can be placed on a property to specify
that the property cannot be used in the $orderby OData query
option.
0
2
NotExpandable
Represents an Attribute that can be placed on a property to specify
that the property cannot be used in the $expand OData query
option.
0
3
NotCountable
Represents an Attribute that can be placed on a property to specify
that the $count cannot be applied on the property.
0
4
[NonFilterable]
[Unsortable]
public string Name { get; set; }
QUERY SECURITY
Consider disabling the any() and all() functions,
as these can be slow.
0
6
If any string properties contain large strings—
for example, a product description or a blog
entry—consider disabling the string functions.
0
7
Consider disallowing filtering on navigation
properties. Filtering on navigation properties
can result in a join, which might be slow,
depending on your database schema.
0
8
Test your service with various queries and
profile the DB.
0
1
Enable server-driven paging, to avoid returning
a large data set in one query.
0
2
Do you need $filter and $orderby? Some
applications might allow client paging, using
$top and $skip, but disable the other query
options.
0
3
Consider restricting $orderby to properties in a
clustered index. Sorting large data without a
clustered index is slow.
0
4
Consider restricting $filter queries by writing a
validator that is customized for your database.
0
9
Maximum node count: The MaxNodeCount
property on [Queryable] sets the maximum
number nodes allowed in the $filter syntax tree.
The default value is 100, but you may want to
set a lower value, because a large number of
nodes can be slow to compile.
0
5
VALIDATION PATHS
Filter Query
Represents a validator used to validate a
FilterQueryOption based on the
ODataValidationSettings.
Order By Query
Represents a validator used to validate an
OrderByQueryOption based on the
ODataValidationSettings.
OData Query
Represents a validator used to validate OData queries
based on the ODataValidationSettings.
Select Expand Query
Represents a validator used to validate a
SelectExpandQueryOption based on the
ODataValidationSettings.
Skip Query
Represents a validator used to validate a
SkipQueryOption based on the
ODataValidationSettings.
Top Query
Represents a validator used to validate a
TopQueryOption based on the
ODataValidationSettings.
QUERY SECURITY
// Validator to prevent filtering on navigation properties.
public class MyFilterQueryValidator : FilterQueryValidator
{
public override void ValidateNavigationPropertyNode(
Microsoft.Data.OData.Query.SemanticAst.QueryNode sourceNode,
Microsoft.Data.Edm.IEdmNavigationProperty navigationProperty,
ODataValidationSettings settings)
{
throw new ODataException("No navigation properties");
}
}
// Validator to restrict which properties can be used in $filter expressions.
public class MyFilterQueryValidator : FilterQueryValidator
{
static readonly string[] allowedProperties = { "ReleaseYear", "Title" };
public override void ValidateSingleValuePropertyAccessNode(
SingleValuePropertyAccessNode propertyAccessNode,
ODataValidationSettings settings)
{
string propertyName = null;
if (propertyAccessNode != null)
{
propertyName = propertyAccessNode.Property.Name;
}
if (propertyName != null && !allowedProperties.Contains(propertyName))
{
throw new ODataException(
String.Format("Filter on {0} not allowed", propertyName));
}
base.ValidateSingleValuePropertyAccessNode(propertyAccessNode,
settings);
}
}
Configuration Settings
Demo
www.chriswoodruff.com Page Number 24
Client Side for OData
DEBUGGING/TESTING
XODATA
Web-based OData Visualizer
FIDDLER
Free web debugging tool which
logs all HTTP(S) traffic between
your computer and the
Internet.
LINQPAD (v3)
Interactively query SQL
databases (among other data
sources such as OData or WCF
Data Services) using LINQ, as
well as interactively writing C#
code without the need for an
IDE.
ODATA
VALIDATOR
Enable OData service authors
to validate their
implementation against the
OData specification to ensure
the service interoperates well
with any OData client.
TESTING/DEBUGGING ODATA
www.websitename.com
CONSUMING ODATA
Demo
Show How to Share an OData Feed in an Universal App
GITHUB
http://github.com/cwoodruff
Project:
ChinookWebAPIOData
ChinookOData
Where can you find the source for this talk?
ODATA WORKSHOP
01
02
03
04
TESTING/DEBUGGING ODATA
DEVELPING CLIENT SIDE SOLUTIONS
• Web Apps using Javascript to consume Odata
• iOS Swift development for native iPhone and iPad
apps
• Windows 8.1 and Windows Phone apps C# and WinJS
• Android development using Java
• Using Xamarin for consuming OData
LEARNING THE PROTOCOL
• The Metadata and Service Model of OData
• URI Conventions of OData
• Format Conventions of OData
• OData HTTP Conventions and Operations
DEVELPING SERVER SIDE SOLUTIONS
• ASP.NET Web API
• Advanced Performance Tips and Best Practices
Go to http://ChrisWoodruff.com for more details and
pricing
THANK YOU
Find me around the conference and would enjoy chatting
Email: cwoodruff@live.com
Twitter: @cwoodruff

More Related Content

What's hot

Building RESTful Applications with OData
Building RESTful Applications with ODataBuilding RESTful Applications with OData
Building RESTful Applications with ODataTodd Anglin
 
Learning To Run - XPages for Lotus Notes Client Developers
Learning To Run - XPages for Lotus Notes Client DevelopersLearning To Run - XPages for Lotus Notes Client Developers
Learning To Run - XPages for Lotus Notes Client DevelopersKathy Brown
 
OData Introduction and Impact on API Design (Webcast)
OData Introduction and Impact on API Design (Webcast)OData Introduction and Impact on API Design (Webcast)
OData Introduction and Impact on API Design (Webcast)Apigee | Google Cloud
 
JAX-RS 2.0 and OData
JAX-RS 2.0 and ODataJAX-RS 2.0 and OData
JAX-RS 2.0 and ODataAnil Allewar
 
OData: A Standard API for Data Access
OData: A Standard API for Data AccessOData: A Standard API for Data Access
OData: A Standard API for Data AccessPat Patterson
 
Salesforce Admin's guide : the data loader from the command line
Salesforce Admin's guide : the data loader from the command lineSalesforce Admin's guide : the data loader from the command line
Salesforce Admin's guide : the data loader from the command lineCyrille Coeurjoly
 
GraphQL & Relay - 串起前後端世界的橋樑
GraphQL & Relay - 串起前後端世界的橋樑GraphQL & Relay - 串起前後端世界的橋樑
GraphQL & Relay - 串起前後端世界的橋樑Pokai Chang
 
Itemscript, a specification for RESTful JSON integration
Itemscript, a specification for RESTful JSON integrationItemscript, a specification for RESTful JSON integration
Itemscript, a specification for RESTful JSON integration{item:foo}
 
Overview of GraphQL & Clients
Overview of GraphQL & ClientsOverview of GraphQL & Clients
Overview of GraphQL & ClientsPokai Chang
 
Salesforce command line data loader
Salesforce command line data loaderSalesforce command line data loader
Salesforce command line data loaderjakkula1099
 
OData for iOS developers
OData for iOS developersOData for iOS developers
OData for iOS developersGlen Gordon
 
Understanding REST APIs in 5 Simple Steps
Understanding REST APIs in 5 Simple StepsUnderstanding REST APIs in 5 Simple Steps
Understanding REST APIs in 5 Simple StepsTessa Mero
 

What's hot (19)

Odata
OdataOdata
Odata
 
Building RESTful Applications with OData
Building RESTful Applications with ODataBuilding RESTful Applications with OData
Building RESTful Applications with OData
 
API Design Tour: Dell
API Design Tour: DellAPI Design Tour: Dell
API Design Tour: Dell
 
Learning To Run - XPages for Lotus Notes Client Developers
Learning To Run - XPages for Lotus Notes Client DevelopersLearning To Run - XPages for Lotus Notes Client Developers
Learning To Run - XPages for Lotus Notes Client Developers
 
OData Introduction and Impact on API Design (Webcast)
OData Introduction and Impact on API Design (Webcast)OData Introduction and Impact on API Design (Webcast)
OData Introduction and Impact on API Design (Webcast)
 
Introduction to OData
Introduction to ODataIntroduction to OData
Introduction to OData
 
JAX-RS 2.0 and OData
JAX-RS 2.0 and ODataJAX-RS 2.0 and OData
JAX-RS 2.0 and OData
 
OData Services
OData ServicesOData Services
OData Services
 
OData: A Standard API for Data Access
OData: A Standard API for Data AccessOData: A Standard API for Data Access
OData: A Standard API for Data Access
 
Salesforce Admin's guide : the data loader from the command line
Salesforce Admin's guide : the data loader from the command lineSalesforce Admin's guide : the data loader from the command line
Salesforce Admin's guide : the data loader from the command line
 
Doing REST Right
Doing REST RightDoing REST Right
Doing REST Right
 
Introduction To REST
Introduction To RESTIntroduction To REST
Introduction To REST
 
GraphQL & Relay - 串起前後端世界的橋樑
GraphQL & Relay - 串起前後端世界的橋樑GraphQL & Relay - 串起前後端世界的橋樑
GraphQL & Relay - 串起前後端世界的橋樑
 
Practical OData
Practical ODataPractical OData
Practical OData
 
Itemscript, a specification for RESTful JSON integration
Itemscript, a specification for RESTful JSON integrationItemscript, a specification for RESTful JSON integration
Itemscript, a specification for RESTful JSON integration
 
Overview of GraphQL & Clients
Overview of GraphQL & ClientsOverview of GraphQL & Clients
Overview of GraphQL & Clients
 
Salesforce command line data loader
Salesforce command line data loaderSalesforce command line data loader
Salesforce command line data loader
 
OData for iOS developers
OData for iOS developersOData for iOS developers
OData for iOS developers
 
Understanding REST APIs in 5 Simple Steps
Understanding REST APIs in 5 Simple StepsUnderstanding REST APIs in 5 Simple Steps
Understanding REST APIs in 5 Simple Steps
 

Viewers also liked

Connecting to Data from Windows Phone 8
Connecting to Data from Windows Phone 8Connecting to Data from Windows Phone 8
Connecting to Data from Windows Phone 8Woodruff Solutions LLC
 
Connecting to Data from Windows Phone 8
Connecting to Data from Windows Phone 8Connecting to Data from Windows Phone 8
Connecting to Data from Windows Phone 8Woodruff Solutions LLC
 
Parade Plan V1.0
Parade Plan V1.0Parade Plan V1.0
Parade Plan V1.0zollida
 
Build Conference Highlights: How Windows 8 Metro is Revolutionary
Build Conference Highlights: How Windows 8 Metro is RevolutionaryBuild Conference Highlights: How Windows 8 Metro is Revolutionary
Build Conference Highlights: How Windows 8 Metro is RevolutionaryWoodruff Solutions LLC
 
Cosmetology, trichology courses
Cosmetology, trichology coursesCosmetology, trichology courses
Cosmetology, trichology coursesdr anil nirale
 
Beneficial courses for medical profession.
Beneficial courses for medical profession.Beneficial courses for medical profession.
Beneficial courses for medical profession.dr anil nirale
 

Viewers also liked (6)

Connecting to Data from Windows Phone 8
Connecting to Data from Windows Phone 8Connecting to Data from Windows Phone 8
Connecting to Data from Windows Phone 8
 
Connecting to Data from Windows Phone 8
Connecting to Data from Windows Phone 8Connecting to Data from Windows Phone 8
Connecting to Data from Windows Phone 8
 
Parade Plan V1.0
Parade Plan V1.0Parade Plan V1.0
Parade Plan V1.0
 
Build Conference Highlights: How Windows 8 Metro is Revolutionary
Build Conference Highlights: How Windows 8 Metro is RevolutionaryBuild Conference Highlights: How Windows 8 Metro is Revolutionary
Build Conference Highlights: How Windows 8 Metro is Revolutionary
 
Cosmetology, trichology courses
Cosmetology, trichology coursesCosmetology, trichology courses
Cosmetology, trichology courses
 
Beneficial courses for medical profession.
Beneficial courses for medical profession.Beneficial courses for medical profession.
Beneficial courses for medical profession.
 

Similar to Configuring OData Feeds for High Performance Web Apps

Wcf data services
Wcf data servicesWcf data services
Wcf data servicesEyal Vardi
 
SAP ODATA Overview & Guidelines
SAP ODATA Overview & GuidelinesSAP ODATA Overview & Guidelines
SAP ODATA Overview & GuidelinesAshish Saxena
 
Implementing access control with zend framework
Implementing access control with zend frameworkImplementing access control with zend framework
Implementing access control with zend frameworkGeorge Mihailov
 
Validate your entities with symfony validator and entity validation api
Validate your entities with symfony validator and entity validation apiValidate your entities with symfony validator and entity validation api
Validate your entities with symfony validator and entity validation apiRaffaele Chiocca
 
OData RESTful implementation
OData RESTful implementationOData RESTful implementation
OData RESTful implementationHari Wiz
 
Gaining the Knowledge of the Open Data Protocol (OData)
Gaining the Knowledge of the Open Data Protocol (OData)Gaining the Knowledge of the Open Data Protocol (OData)
Gaining the Knowledge of the Open Data Protocol (OData)Woodruff Solutions LLC
 
Learning How to Shape and Configure an OData Feed for High Performing Web Sit...
Learning How to Shape and Configure an OData Feed for High Performing Web Sit...Learning How to Shape and Configure an OData Feed for High Performing Web Sit...
Learning How to Shape and Configure an OData Feed for High Performing Web Sit...Woodruff Solutions LLC
 
Rest with Java EE 6 , Security , Backbone.js
Rest with Java EE 6 , Security , Backbone.jsRest with Java EE 6 , Security , Backbone.js
Rest with Java EE 6 , Security , Backbone.jsCarol McDonald
 
Building RESTfull Data Services with WebAPI
Building RESTfull Data Services with WebAPIBuilding RESTfull Data Services with WebAPI
Building RESTfull Data Services with WebAPIGert Drapers
 
MuleSoft London Community February 2020 - MuleSoft and OData
MuleSoft London Community February 2020 - MuleSoft and ODataMuleSoft London Community February 2020 - MuleSoft and OData
MuleSoft London Community February 2020 - MuleSoft and ODataPace Integration
 
Data Access Options in SharePoint 2010
Data Access Options in SharePoint 2010Data Access Options in SharePoint 2010
Data Access Options in SharePoint 2010Rob Windsor
 
Consuming Data From Many Platforms: The Benefits of OData - St. Louis Day of ...
Consuming Data From Many Platforms: The Benefits of OData - St. Louis Day of ...Consuming Data From Many Platforms: The Benefits of OData - St. Louis Day of ...
Consuming Data From Many Platforms: The Benefits of OData - St. Louis Day of ...Eric D. Boyd
 
Webservices in SalesForce (part 1)
Webservices in SalesForce (part 1)Webservices in SalesForce (part 1)
Webservices in SalesForce (part 1)Mindfire Solutions
 
JAX-RS JavaOne Hyderabad, India 2011
JAX-RS JavaOne Hyderabad, India 2011JAX-RS JavaOne Hyderabad, India 2011
JAX-RS JavaOne Hyderabad, India 2011Shreedhar Ganapathy
 
OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)
OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)
OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)Pat Patterson
 
Android App Development 06 : Network & Web Services
Android App Development 06 : Network & Web ServicesAndroid App Development 06 : Network & Web Services
Android App Development 06 : Network & Web ServicesAnuchit Chalothorn
 
How do i... query foreign data using sql server's linked servers tech_repu
How do i... query foreign data using sql server's linked servers    tech_repuHow do i... query foreign data using sql server's linked servers    tech_repu
How do i... query foreign data using sql server's linked servers tech_repuKaing Menglieng
 
JAX-RS. Developing RESTful APIs with Java
JAX-RS. Developing RESTful APIs with JavaJAX-RS. Developing RESTful APIs with Java
JAX-RS. Developing RESTful APIs with JavaJerry Kurian
 

Similar to Configuring OData Feeds for High Performance Web Apps (20)

Wcf data services
Wcf data servicesWcf data services
Wcf data services
 
SAP ODATA Overview & Guidelines
SAP ODATA Overview & GuidelinesSAP ODATA Overview & Guidelines
SAP ODATA Overview & Guidelines
 
Implementing access control with zend framework
Implementing access control with zend frameworkImplementing access control with zend framework
Implementing access control with zend framework
 
Validate your entities with symfony validator and entity validation api
Validate your entities with symfony validator and entity validation apiValidate your entities with symfony validator and entity validation api
Validate your entities with symfony validator and entity validation api
 
OData RESTful implementation
OData RESTful implementationOData RESTful implementation
OData RESTful implementation
 
Gaining the Knowledge of the Open Data Protocol (OData)
Gaining the Knowledge of the Open Data Protocol (OData)Gaining the Knowledge of the Open Data Protocol (OData)
Gaining the Knowledge of the Open Data Protocol (OData)
 
Learning How to Shape and Configure an OData Feed for High Performing Web Sit...
Learning How to Shape and Configure an OData Feed for High Performing Web Sit...Learning How to Shape and Configure an OData Feed for High Performing Web Sit...
Learning How to Shape and Configure an OData Feed for High Performing Web Sit...
 
Rest
RestRest
Rest
 
Rest with Java EE 6 , Security , Backbone.js
Rest with Java EE 6 , Security , Backbone.jsRest with Java EE 6 , Security , Backbone.js
Rest with Java EE 6 , Security , Backbone.js
 
Building RESTfull Data Services with WebAPI
Building RESTfull Data Services with WebAPIBuilding RESTfull Data Services with WebAPI
Building RESTfull Data Services with WebAPI
 
MuleSoft London Community February 2020 - MuleSoft and OData
MuleSoft London Community February 2020 - MuleSoft and ODataMuleSoft London Community February 2020 - MuleSoft and OData
MuleSoft London Community February 2020 - MuleSoft and OData
 
Data Access Options in SharePoint 2010
Data Access Options in SharePoint 2010Data Access Options in SharePoint 2010
Data Access Options in SharePoint 2010
 
Consuming Data From Many Platforms: The Benefits of OData - St. Louis Day of ...
Consuming Data From Many Platforms: The Benefits of OData - St. Louis Day of ...Consuming Data From Many Platforms: The Benefits of OData - St. Louis Day of ...
Consuming Data From Many Platforms: The Benefits of OData - St. Louis Day of ...
 
Webservices in SalesForce (part 1)
Webservices in SalesForce (part 1)Webservices in SalesForce (part 1)
Webservices in SalesForce (part 1)
 
JAX-RS JavaOne Hyderabad, India 2011
JAX-RS JavaOne Hyderabad, India 2011JAX-RS JavaOne Hyderabad, India 2011
JAX-RS JavaOne Hyderabad, India 2011
 
OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)
OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)
OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)
 
Android App Development 06 : Network & Web Services
Android App Development 06 : Network & Web ServicesAndroid App Development 06 : Network & Web Services
Android App Development 06 : Network & Web Services
 
RESTfulDay9
RESTfulDay9RESTfulDay9
RESTfulDay9
 
How do i... query foreign data using sql server's linked servers tech_repu
How do i... query foreign data using sql server's linked servers    tech_repuHow do i... query foreign data using sql server's linked servers    tech_repu
How do i... query foreign data using sql server's linked servers tech_repu
 
JAX-RS. Developing RESTful APIs with Java
JAX-RS. Developing RESTful APIs with JavaJAX-RS. Developing RESTful APIs with Java
JAX-RS. Developing RESTful APIs with Java
 

More from Woodruff Solutions LLC

Developing Mobile Solutions with Azure Mobile Services in Windows 8.1 and Win...
Developing Mobile Solutions with Azure Mobile Services in Windows 8.1 and Win...Developing Mobile Solutions with Azure Mobile Services in Windows 8.1 and Win...
Developing Mobile Solutions with Azure Mobile Services in Windows 8.1 and Win...Woodruff Solutions LLC
 
Pushing Data to and from the Cloud with SQL Azure Data Sync -- TechEd NA 2013
Pushing Data to and from the Cloud with SQL Azure Data Sync -- TechEd NA 2013Pushing Data to and from the Cloud with SQL Azure Data Sync -- TechEd NA 2013
Pushing Data to and from the Cloud with SQL Azure Data Sync -- TechEd NA 2013Woodruff Solutions LLC
 
Developing Mobile Solutions with Azure and Windows Phone VSLive! Redmond 2013
Developing Mobile Solutions with Azure and Windows Phone VSLive! Redmond 2013Developing Mobile Solutions with Azure and Windows Phone VSLive! Redmond 2013
Developing Mobile Solutions with Azure and Windows Phone VSLive! Redmond 2013Woodruff Solutions LLC
 
Connecting to Data from Windows Phone 8 VSLive! Redmond 2013
Connecting to Data from Windows Phone 8 VSLive! Redmond 2013Connecting to Data from Windows Phone 8 VSLive! Redmond 2013
Connecting to Data from Windows Phone 8 VSLive! Redmond 2013Woodruff Solutions LLC
 
AzureConf 2013 Developing Cross Platform Mobile Solutions with Azure Mobile...
AzureConf 2013   Developing Cross Platform Mobile Solutions with Azure Mobile...AzureConf 2013   Developing Cross Platform Mobile Solutions with Azure Mobile...
AzureConf 2013 Developing Cross Platform Mobile Solutions with Azure Mobile...Woodruff Solutions LLC
 
Breaking down data silos with the open data protocol
Breaking down data silos with the open data protocolBreaking down data silos with the open data protocol
Breaking down data silos with the open data protocolWoodruff Solutions LLC
 

More from Woodruff Solutions LLC (10)

Developing Mobile Solutions with Azure Mobile Services in Windows 8.1 and Win...
Developing Mobile Solutions with Azure Mobile Services in Windows 8.1 and Win...Developing Mobile Solutions with Azure Mobile Services in Windows 8.1 and Win...
Developing Mobile Solutions with Azure Mobile Services in Windows 8.1 and Win...
 
Pushing Data to and from the Cloud with SQL Azure Data Sync -- TechEd NA 2013
Pushing Data to and from the Cloud with SQL Azure Data Sync -- TechEd NA 2013Pushing Data to and from the Cloud with SQL Azure Data Sync -- TechEd NA 2013
Pushing Data to and from the Cloud with SQL Azure Data Sync -- TechEd NA 2013
 
Developing Mobile Solutions with Azure and Windows Phone VSLive! Redmond 2013
Developing Mobile Solutions with Azure and Windows Phone VSLive! Redmond 2013Developing Mobile Solutions with Azure and Windows Phone VSLive! Redmond 2013
Developing Mobile Solutions with Azure and Windows Phone VSLive! Redmond 2013
 
Connecting to Data from Windows Phone 8 VSLive! Redmond 2013
Connecting to Data from Windows Phone 8 VSLive! Redmond 2013Connecting to Data from Windows Phone 8 VSLive! Redmond 2013
Connecting to Data from Windows Phone 8 VSLive! Redmond 2013
 
AzureConf 2013 Developing Cross Platform Mobile Solutions with Azure Mobile...
AzureConf 2013   Developing Cross Platform Mobile Solutions with Azure Mobile...AzureConf 2013   Developing Cross Platform Mobile Solutions with Azure Mobile...
AzureConf 2013 Developing Cross Platform Mobile Solutions with Azure Mobile...
 
Sql Azure Data Sync
Sql Azure Data SyncSql Azure Data Sync
Sql Azure Data Sync
 
Producing an OData feed in 10 minutes
Producing an OData feed in 10 minutesProducing an OData feed in 10 minutes
Producing an OData feed in 10 minutes
 
Sailing on the ocean of 1s and 0s
Sailing on the ocean of 1s and 0sSailing on the ocean of 1s and 0s
Sailing on the ocean of 1s and 0s
 
Breaking down data silos with OData
Breaking down data silos with ODataBreaking down data silos with OData
Breaking down data silos with OData
 
Breaking down data silos with the open data protocol
Breaking down data silos with the open data protocolBreaking down data silos with the open data protocol
Breaking down data silos with the open data protocol
 

Recently uploaded

Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 

Recently uploaded (20)

Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 

Configuring OData Feeds for High Performance Web Apps

  • 1. Learning How to Shape and Configure an OData Feed for High Performing Web Sites and Applications PRAIRIE DEVCON CHRIS WOODRUFF
  • 2. Hi, I’m Woody! • Chris Woodruff • cwoodruff@live.com • http://chriswoodruff.com • http://deepfriedbytes.com • twitter @cwoodruff
  • 3. VALIDATION CLIENT SIDEBEST PRACTICES AGENDA
  • 4. What are the 2 Sides of OData? SERVER-SIDE (PRODUCER) CLIENT-SIDE (CONSUMER)
  • 6. UNDERSTAND REST The Top Reasons You Need to Learn about Data in Your Windows Phone App
  • 7.
  • 9. WHAT SHOULD YOU KNOW ABOUT REST? Resources REST uses addressable resources to define the structure of the API. These are the URLs you use to get to pages on the web Request Headers These are additional instructions that are sent with the request. These might define what type of response is required or authorization details. Request Verbs These describe what you want to do with the resource. A browser typically issues a GET verb to instruct the endpoint it wants to get data, however there are many other verbs available including things like POST, PUT and DELETE. Request Body Data that is sent with the request. For example a POST (creation of a new item) will required some data which is typically sent as the request body in the format of JSON or XML. Response Body This is the main body of the response. If the request was to a web server, this might be a full HTML page, if it was to an API, this might be a JSON or XML document. Response Status codes These codes are issues with the response and give the client details on the status of the request.
  • 10. REST & HTTP VERBS GET Requests a representation of the specified Requests using GET should only retrieve have no other effect. POST Requests that the server accept the entity enclosed in the request as a new subordinate of the web resource identified by the URI. PUT Requests that the enclosed entity be stored under the supplied URI. DELETE Deletes the specified resource.
  • 11. EXAMPLES OF REST AND ODATA /Products RESOURCE EXPECTED OUTCOMEVERB RESPONSE CODE /Products?$filter=Color eq ‘Red' /Products /Products(81) /Products(881) /Products(81) /Products(81) GET GET POST GET GET PUT DELETE A list of all products in the system A list of all products in the system where the color is red Creation of a new product Product with an ID of 81 Some error message Update of the product with ID of 81 Deletion of the product with ID of 81 200/OK 200/OK 201/Created 200/OK 404/Not Found 204/No Content 204/No Content
  • 13. Get to know the OData Protocol!!!
  • 18. QUERYABLE ODATAATTRIBUTES AllowedFunctions Consider disabling the any() and all() functions, as these can be 0 5 IgnoreDataMember (not with Queryable) Represents an Attribute that can be placed on a property to specify that the property cannot be navigated in OData query. 0 6 PageSize Enable server-driven paging, to avoid returning a large data set in one query. For more information 0 1 AllowedQueryOptions Do you need $filter and $orderby? Some applications might allow client paging, using $top and $skip, but disable the other query options. 0 2 AllowedOrderByProperties Consider restricting $orderby to properties in a clustered index. Sorting large data without a clustered index is slow. 0 3 MaxNodeCount The MaxNodeCount property on [Queryable] sets the maximum number nodes allowed in the $filter syntax tree. The default value is 100, but you may want to set a lower value, because a large number of nodes can be slow to compile. This is particularly true if you are using LINQ to Objects 0 4
  • 19. ODATAATTRIBUTES (CONT) NotExpandable Represents an Attribute that can be placed on a property to specify be used in the $expand OData query option. 0 5 NotNavigable Represents an Attribute that can be placed on a property to specify that the property cannot be navigated in OData query. 0 6 NotSortable Represents an attribute that can be placed on a property to specify that the property cannot be used in the $orderby OData query option. 0 7 NonFilterable Represents an Attribute that can be placed on a property to specify that the property cannot be used in the $filter OData query option. 0 1 UnSortable Represents an Attribute that can be placed on a property to specify that the property cannot be used in the $orderby OData query option. 0 2 NotExpandable Represents an Attribute that can be placed on a property to specify that the property cannot be used in the $expand OData query option. 0 3 NotCountable Represents an Attribute that can be placed on a property to specify that the $count cannot be applied on the property. 0 4 [NonFilterable] [Unsortable] public string Name { get; set; }
  • 20. QUERY SECURITY Consider disabling the any() and all() functions, as these can be slow. 0 6 If any string properties contain large strings— for example, a product description or a blog entry—consider disabling the string functions. 0 7 Consider disallowing filtering on navigation properties. Filtering on navigation properties can result in a join, which might be slow, depending on your database schema. 0 8 Test your service with various queries and profile the DB. 0 1 Enable server-driven paging, to avoid returning a large data set in one query. 0 2 Do you need $filter and $orderby? Some applications might allow client paging, using $top and $skip, but disable the other query options. 0 3 Consider restricting $orderby to properties in a clustered index. Sorting large data without a clustered index is slow. 0 4 Consider restricting $filter queries by writing a validator that is customized for your database. 0 9 Maximum node count: The MaxNodeCount property on [Queryable] sets the maximum number nodes allowed in the $filter syntax tree. The default value is 100, but you may want to set a lower value, because a large number of nodes can be slow to compile. 0 5
  • 21. VALIDATION PATHS Filter Query Represents a validator used to validate a FilterQueryOption based on the ODataValidationSettings. Order By Query Represents a validator used to validate an OrderByQueryOption based on the ODataValidationSettings. OData Query Represents a validator used to validate OData queries based on the ODataValidationSettings. Select Expand Query Represents a validator used to validate a SelectExpandQueryOption based on the ODataValidationSettings. Skip Query Represents a validator used to validate a SkipQueryOption based on the ODataValidationSettings. Top Query Represents a validator used to validate a TopQueryOption based on the ODataValidationSettings.
  • 22. QUERY SECURITY // Validator to prevent filtering on navigation properties. public class MyFilterQueryValidator : FilterQueryValidator { public override void ValidateNavigationPropertyNode( Microsoft.Data.OData.Query.SemanticAst.QueryNode sourceNode, Microsoft.Data.Edm.IEdmNavigationProperty navigationProperty, ODataValidationSettings settings) { throw new ODataException("No navigation properties"); } } // Validator to restrict which properties can be used in $filter expressions. public class MyFilterQueryValidator : FilterQueryValidator { static readonly string[] allowedProperties = { "ReleaseYear", "Title" }; public override void ValidateSingleValuePropertyAccessNode( SingleValuePropertyAccessNode propertyAccessNode, ODataValidationSettings settings) { string propertyName = null; if (propertyAccessNode != null) { propertyName = propertyAccessNode.Property.Name; } if (propertyName != null && !allowedProperties.Contains(propertyName)) { throw new ODataException( String.Format("Filter on {0} not allowed", propertyName)); } base.ValidateSingleValuePropertyAccessNode(propertyAccessNode, settings); } }
  • 27. XODATA Web-based OData Visualizer FIDDLER Free web debugging tool which logs all HTTP(S) traffic between your computer and the Internet. LINQPAD (v3) Interactively query SQL databases (among other data sources such as OData or WCF Data Services) using LINQ, as well as interactively writing C# code without the need for an IDE. ODATA VALIDATOR Enable OData service authors to validate their implementation against the OData specification to ensure the service interoperates well with any OData client. TESTING/DEBUGGING ODATA www.websitename.com
  • 29. Demo Show How to Share an OData Feed in an Universal App
  • 31. ODATA WORKSHOP 01 02 03 04 TESTING/DEBUGGING ODATA DEVELPING CLIENT SIDE SOLUTIONS • Web Apps using Javascript to consume Odata • iOS Swift development for native iPhone and iPad apps • Windows 8.1 and Windows Phone apps C# and WinJS • Android development using Java • Using Xamarin for consuming OData LEARNING THE PROTOCOL • The Metadata and Service Model of OData • URI Conventions of OData • Format Conventions of OData • OData HTTP Conventions and Operations DEVELPING SERVER SIDE SOLUTIONS • ASP.NET Web API • Advanced Performance Tips and Best Practices Go to http://ChrisWoodruff.com for more details and pricing
  • 32. THANK YOU Find me around the conference and would enjoy chatting Email: cwoodruff@live.com Twitter: @cwoodruff

Editor's Notes

  1. 200 OK -- Standard response for successful HTTP requests. The actual response will depend on the request method used. In a GET request, the response will contain an entity corresponding to the requested resource. In a POST request the response will contain an entity describing or containing the result of the action. 201 Created -- The request has been fulfilled and resulted in a new resource being created. 204 No Content -- The server successfully processed the request, but is not returning any content. Usually used as a response to a successful delete request. 404 Not Found -- The requested resource could not be found but may be available again in the future. Subsequent requests by the client are permissible.
  2. // Disable any() and all() functions. [Queryable(AllowedFunctions= AllowedFunctions.AllFunctions & ~AllowedFunctions.All & ~AllowedFunctions.Any)]
  3. // Validator to prevent filtering on navigation properties. public class MyFilterQueryValidator : FilterQueryValidator { public override void ValidateNavigationPropertyNode( Microsoft.Data.OData.Query.SemanticAst.QueryNode sourceNode, Microsoft.Data.Edm.IEdmNavigationProperty navigationProperty, ODataValidationSettings settings) { throw new ODataException("No navigation properties"); } } // Validator to restrict which properties can be used in $filter expressions. public class MyFilterQueryValidator : FilterQueryValidator { static readonly string[] allowedProperties = { "ReleaseYear", "Title" }; public override void ValidateSingleValuePropertyAccessNode( SingleValuePropertyAccessNode propertyAccessNode, ODataValidationSettings settings) { string propertyName = null; if (propertyAccessNode != null) { propertyName = propertyAccessNode.Property.Name; } if (propertyName != null && !allowedProperties.Contains(propertyName)) { throw new ODataException( String.Format("Filter on {0} not allowed", propertyName)); } base.ValidateSingleValuePropertyAccessNode(propertyAccessNode, settings); } }