Photo Credits : Konstantinos Poulakos Introduction to Azure DocumentDB Athens Apr 21, 2017
PresenterInfo 1982 I started working with computers 1988 I started my professional career in computers industry. 1996 I started working with SQL Server 6.0 1998 I earned my first certification at Microsoft as Microsoft Certified Solution Developer (3rd in Greece) I started my career as Microsoft Certified Trainer (MCT) with more than 30.000 hours of training until now! 2010 I became for first time Microsoft MVP on Data Platform I created the SQL School Greece www.sqlschool.gr 2012 I became MCT Regional Lead by Microsoft Learning Program. 2013 I was certified as MCSE : Data Platform & MCSE : Business Intelligence 2016 I was certified as MCSE: Data Management & Analytics Antonios Chatzipavlis SQL Server Expert & Evangelist
SQLschool.gr Μια πηγή ενημέρωσης για τον Microsoft SQL Server προς τους Έλληνες IT Professionals, DBAs, Developers, Information Workers αλλά και απλούς χομπίστες που απλά τους αρέσει ο SQL Server. Help line : help@sqlschool.gr • Articles about SQL Server • SQL Server News • SQL Nights • Webcasts • Downloads • Resources What we are doing here Follow us in socials fb/sqlschoolgr fb/groups/sqlschool @antoniosch @sqlschool yt/c/SqlschoolGr SQL School Greece group S E L E C T K N O W L E D G E F R O M S Q L S E R V E R
▪ Sign up for a free membership today at sqlpass.org. ▪ Linked In: http://www.sqlpass.org/linkedin ▪ Facebook: http://www.sqlpass.org/facebook ▪ Twitter: @SQLPASS ▪ PASS: http://www.sqlpass.org
PresentationContent ▪ Introduction to DocumentDB ▪ Start Working with DocumentDB ▪ Writing Queries in DocumentDB ▪ Programming in DocumentDB Server
Introduction to DocumentDB
▪ DocumentDB is a fully managed NoSQL database service ▪ Built for fast and predictable performance, high availability, elastic scaling, global distribution, and ease of development. ▪ Is a schema-free NoSQL database ▪ Provides rich and familiar SQL query capabilities with consistent low latencies on JSON data (ensuring that 99% of your reads are served under 10 milliseconds and 99% of your writes are served under 15 milliseconds.) ▪ DocumentDB is a great fit for web, mobile, gaming, and IoT ▪ and many other applications that need seamless scale and global replication. What is DocumentDB
▪ Elastically scalable throughput and storage ▪ Multi-region replication ▪ Ad hoc queries with familiar SQL syntax ▪ JavaScript execution within the database ▪ Tunable consistency levels ▪ Fully managed ▪ Open by design ▪ Automatic indexing ▪ Compatibility with MongoDB apps What capabilities and key features does DocumentDB offer?
How does DocumentDB manage data?
▪ DocumentDB stores data as collections of documents. ▪ Your application can use a variety of operation types supported by DocumentDB, including CRUD, SQL and JavaScript queries, as well as stored procedures to work with documents. ▪ For each collection, you get guaranteed throughput for all supported operations using a measure of throughput called Request Units per second (RUs). ▪ For example, a read operation on a 1KB document requires 1 RU. ▪ You can adjust reserved RUs for each collection programmatically or via the portal at any time regardless of the amount of the data stored. ▪ DocumentDB Emulator (Free) ▪ Download the free DocumentDB Emulator to develop and test applications using DocumentDB from your local machine. Once you’re satisfied with how your application works, you can deploy it by just changing your configuration to point to an Azure DocumentDB instance. DocumentDB Pricing
Start Working with DocumentDB
Get Microsoft Account http://singup.live.com Get Microsoft Azure Subscription http://azure.microsoft.com Before Working with DocumentDB
DocumentDB Resource Model
Resource Properties Property Description Id User defined unique ID (string) _rid Resource ID _ts Timestamp (last updated) epoch value _etag GUID used for optimistic concurrency _self URI path to the resource
DEMO
Writing Queries in DocumentDB
▪ SQL grammar support for querying documents ▪ SELECT, FROM, WHERE, JOIN, IN, BETWEEN, ORDER BY ▪ Operators ▪ Arithmetic operators : + , - , * , / , % ▪ Bitwise operators : | , & , ^ , < , >> , >>> (zero-fill right shift) ▪ Logical operators: AND , OR ▪ Comparison operators : = , != , > , >= , < , <= , <> ▪ String operator : || (string concatenate) ▪ Built-in Functions ▪ Math : ABS, CEILING, EXP, POWER, ROUND, PI … ▪ Type checking : IS_ARRAY, IS_BOOL, IS_NULL, IS_NUMBER, IS_OBJECT, IS_STRING, IS_DEFINED, IS_PRIMITIVE ▪ String : CONCAT, CONTAINS, ENDSWITH, INDEX_OF, LEFT, LENGTH, REPLACE, SUBSTRING … ▪ Array : ARRAY_CONCAT, ARRAY_CONTAINS, ARRAY_LENGHT, ARRAY_SLICE DocumentDB Queries
DEMO
Programming in DocumentDB Server
▪ You can write code that runs inside DocumentDB using Stored Procedures, Triggers, User defined functions ▪ JavaScript as T-SQL ▪ Full support of ACID (transactions) ▪ Bounded executions ▪ Handle throttling errors (code 429) Server Side Programming Model
Server Side Programming Objects Stored Procedures JavaScript function Receive input parameters in function signature Operate on any document in the collecation Return any response Triggers JavaScript function Pre-Triggers Runs before the operation executes Post-trigger Runs after the operation executes Triggers do not fire automatically UDFs JavaScript function Querying on a UDF requires a scan (cannot use index) No access to context
DEMO
SELECT KNOWLEDGE FROM SQL SERVER Copyright © 2017 SQLschool.gr. All right reserved. PRESENTER MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION

Introduction to azure document db

  • 2.
    Photo Credits :Konstantinos Poulakos Introduction to Azure DocumentDB Athens Apr 21, 2017
  • 3.
    PresenterInfo 1982 I startedworking with computers 1988 I started my professional career in computers industry. 1996 I started working with SQL Server 6.0 1998 I earned my first certification at Microsoft as Microsoft Certified Solution Developer (3rd in Greece) I started my career as Microsoft Certified Trainer (MCT) with more than 30.000 hours of training until now! 2010 I became for first time Microsoft MVP on Data Platform I created the SQL School Greece www.sqlschool.gr 2012 I became MCT Regional Lead by Microsoft Learning Program. 2013 I was certified as MCSE : Data Platform & MCSE : Business Intelligence 2016 I was certified as MCSE: Data Management & Analytics Antonios Chatzipavlis SQL Server Expert & Evangelist
  • 4.
    SQLschool.gr Μια πηγή ενημέρωσηςγια τον Microsoft SQL Server προς τους Έλληνες IT Professionals, DBAs, Developers, Information Workers αλλά και απλούς χομπίστες που απλά τους αρέσει ο SQL Server. Help line : help@sqlschool.gr • Articles about SQL Server • SQL Server News • SQL Nights • Webcasts • Downloads • Resources What we are doing here Follow us in socials fb/sqlschoolgr fb/groups/sqlschool @antoniosch @sqlschool yt/c/SqlschoolGr SQL School Greece group S E L E C T K N O W L E D G E F R O M S Q L S E R V E R
  • 5.
    ▪ Sign upfor a free membership today at sqlpass.org. ▪ Linked In: http://www.sqlpass.org/linkedin ▪ Facebook: http://www.sqlpass.org/facebook ▪ Twitter: @SQLPASS ▪ PASS: http://www.sqlpass.org
  • 7.
    PresentationContent ▪ Introduction toDocumentDB ▪ Start Working with DocumentDB ▪ Writing Queries in DocumentDB ▪ Programming in DocumentDB Server
  • 8.
  • 9.
    ▪ DocumentDB isa fully managed NoSQL database service ▪ Built for fast and predictable performance, high availability, elastic scaling, global distribution, and ease of development. ▪ Is a schema-free NoSQL database ▪ Provides rich and familiar SQL query capabilities with consistent low latencies on JSON data (ensuring that 99% of your reads are served under 10 milliseconds and 99% of your writes are served under 15 milliseconds.) ▪ DocumentDB is a great fit for web, mobile, gaming, and IoT ▪ and many other applications that need seamless scale and global replication. What is DocumentDB
  • 10.
    ▪ Elastically scalablethroughput and storage ▪ Multi-region replication ▪ Ad hoc queries with familiar SQL syntax ▪ JavaScript execution within the database ▪ Tunable consistency levels ▪ Fully managed ▪ Open by design ▪ Automatic indexing ▪ Compatibility with MongoDB apps What capabilities and key features does DocumentDB offer?
  • 11.
  • 12.
    ▪ DocumentDB storesdata as collections of documents. ▪ Your application can use a variety of operation types supported by DocumentDB, including CRUD, SQL and JavaScript queries, as well as stored procedures to work with documents. ▪ For each collection, you get guaranteed throughput for all supported operations using a measure of throughput called Request Units per second (RUs). ▪ For example, a read operation on a 1KB document requires 1 RU. ▪ You can adjust reserved RUs for each collection programmatically or via the portal at any time regardless of the amount of the data stored. ▪ DocumentDB Emulator (Free) ▪ Download the free DocumentDB Emulator to develop and test applications using DocumentDB from your local machine. Once you’re satisfied with how your application works, you can deploy it by just changing your configuration to point to an Azure DocumentDB instance. DocumentDB Pricing
  • 13.
  • 14.
    Get Microsoft Account http://singup.live.com GetMicrosoft Azure Subscription http://azure.microsoft.com Before Working with DocumentDB
  • 15.
  • 16.
    Resource Properties Property Description IdUser defined unique ID (string) _rid Resource ID _ts Timestamp (last updated) epoch value _etag GUID used for optimistic concurrency _self URI path to the resource
  • 17.
  • 18.
  • 19.
    ▪ SQL grammarsupport for querying documents ▪ SELECT, FROM, WHERE, JOIN, IN, BETWEEN, ORDER BY ▪ Operators ▪ Arithmetic operators : + , - , * , / , % ▪ Bitwise operators : | , & , ^ , < , >> , >>> (zero-fill right shift) ▪ Logical operators: AND , OR ▪ Comparison operators : = , != , > , >= , < , <= , <> ▪ String operator : || (string concatenate) ▪ Built-in Functions ▪ Math : ABS, CEILING, EXP, POWER, ROUND, PI … ▪ Type checking : IS_ARRAY, IS_BOOL, IS_NULL, IS_NUMBER, IS_OBJECT, IS_STRING, IS_DEFINED, IS_PRIMITIVE ▪ String : CONCAT, CONTAINS, ENDSWITH, INDEX_OF, LEFT, LENGTH, REPLACE, SUBSTRING … ▪ Array : ARRAY_CONCAT, ARRAY_CONTAINS, ARRAY_LENGHT, ARRAY_SLICE DocumentDB Queries
  • 20.
  • 21.
  • 22.
    ▪ You canwrite code that runs inside DocumentDB using Stored Procedures, Triggers, User defined functions ▪ JavaScript as T-SQL ▪ Full support of ACID (transactions) ▪ Bounded executions ▪ Handle throttling errors (code 429) Server Side Programming Model
  • 23.
    Server Side ProgrammingObjects Stored Procedures JavaScript function Receive input parameters in function signature Operate on any document in the collecation Return any response Triggers JavaScript function Pre-Triggers Runs before the operation executes Post-trigger Runs after the operation executes Triggers do not fire automatically UDFs JavaScript function Querying on a UDF requires a scan (cannot use index) No access to context
  • 24.
  • 27.
    SELECT KNOWLEDGE FROMSQL SERVER Copyright © 2017 SQLschool.gr. All right reserved. PRESENTER MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION