Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved.
DEVELOPE...
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 2
Eben H...
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved.
OBJECTIV...
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved.
1
QUERY
...
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 5
Query ...
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 6
Visual...
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 7
Visual...
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 8
Schema...
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 9
Schema...
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 10
Query...
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 11
Query...
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 12
Query...
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved.
2 QUERY
...
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 14
Query...
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 15
Query...
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved.
3
COUCHB...
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 17
CBImp...
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 18
CBExp...
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved.
4 COUCHB...
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 20
Couch...
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 21
Couch...
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved.
5 DEMO !...
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved.
THANK
YO...
Upcoming SlideShare
Loading in …5
×

Productivity tools: new 5.0 features, N1QL queries, and more – Connect Silicon Valley 2017

176 views

Published on

Speaker: Eben Haber

Keeping up with the latest tools and changes is always a challenge. Graphical N1QL query monitoring, adaptive indexing, and profiling updates are just some of the updates for developers in Couchbase Server 5.0.

Join this developer-centric, demo-filled session to quickly learn about the newest developer tools and enhancements included with Couchbase Server. This session will cover new tools for data import/export, JSON schema exploration, N1QL Query Workbench, query plan visualization and performance tuning, and command-line query execution. Learn about these new tools and how they accelerate and simplify application development.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Productivity tools: new 5.0 features, N1QL queries, and more – Connect Silicon Valley 2017

  1. 1. Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. DEVELOPER FEATURES What’s New in Couchbase 5.0 1
  2. 2. Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 2 Eben Haber Senior Software Engineer & User Advocate LinkedIn – https://www.linkedin.com/in/ebenhaber Your Presenter 2
  3. 3. Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. OBJECTIVES 1 2 3 4 5 Query Workbench Enhancements Query Monitoring Couchbase Import/Export Tools Couchbase Web Console Demo 3
  4. 4. Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 1 QUERY WORKBENCH ENHANCEMENTS 4
  5. 5. Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 5 Query Plans in the Query Workbench • Plans help explain query performance • New “Explain” button – get the query plan without adding “explain” keyword • Workbench also automatically runs “Explain” with every query. Plans stored in the Query History, so you can re-examine plans from prior queries • Workbench queries also set ‘collect timings’ parameter, plan result shows time spent in each operator • Even better, now supports visual query plans
  6. 6. Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 6 Visual Query Plan 6
  7. 7. Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 7 Visual Query Plan (Explain) 7 Textual query plans are lengthy and hard to read.Version 5.0 now supports Visual query plans. Shows the query execution plan in easy to understand visual flow diagrams and additionally provide other useful information. Each visual query plan displays • summary of buckets, fields, indexes used in query • visual tree of query operators, After query execution, can show: • time spent per operator • cost of each operator as a percentage of the total cost of the plan • number of items processed (input & output) • highlighted expensive operators
  8. 8. Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 8 Schema Inferencing/INFER • No fixed schemas in Couchbase • Document structure can evolve as the developer sees fit • Yet documents usually share common structure(s) • INFER command (added in 4.5) randomly samples documents from a bucket, produces schema(s) (compatable with http://json-schema.org) • Based on a random sample, schemas are a “guess”, may miss rare elements • In 5.0: • Workbench automatically infers schemas for each bucket in background • Schemas come up more quickly in Bucket Insights Panel • Field/Index names available for auto-completion when writing queries • Workbench also shows document counts for each bucket
  9. 9. Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 9 Schema Inferencing and Query Checking • Couchbase has no fixed schema, can’t normally detect typos/non-existent fields • Instead of a syntax error, you get unexpected result • Release 5.0 has partial solution: • Workbench automatically does schema inferencing (INFER) on each bucket. • Inferred schema, combined with query plan, can identify some misspelled/incorrect field names • False positives for very rare fields, not found by INFER • False negatives for nested queries and expressions (e.g., ARRAY) not processed in query plan
  10. 10. Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 10 Query History maintains a history of all the queries executed on the Query Workbench • scroll through the history window or use arrow keys at the top of the editor to navigate • search the query history by entering a text in the search box located on the top • delete the currently selected query from the history • delete all the entire query history Enhanced Query History
  11. 11. Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 11 Query Preferences Query Preferences provides you with ability to change the run-time settings for Query Service through Run-Time Preferences window - Collect query timings - Max Parallelism - Scan Consistency - Positional Parameters - Named Parameters - (or regular query HTTP params, if “$” omitted) - Query Timeout (default 5 min)
  12. 12. Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 12 Query Import/Export Query Import/Export provides you with tools to • Load the saved query from a file into the Query Editor • Export the query statement in the .txt format • Export the query results in the JSON format 12
  13. 13. Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 2 QUERY MONITORING 13
  14. 14. Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 14 Query Monitoring 14 Since 4.5, Couchbase provided node-specific query information: e.g., system:active_requests In 5.0, global query information, i.e. details of queries that are “active” (currently running), “completed” (recently run), or “prepared” (aggregate statistics for prepared queries) and ability to cancel/kill long-running queries. Query Monitoring UI displays • Active Queries – all running queries are displayed, with details such as the query text, the node IP address, duration, request identification number, and the current state of the query. Additionally, provide ability to cancel a long running query. • Completed Queries – all completed queries that took longer than 1 second, with details as above plus result count and timestamp. • Prepared Queries - aggregate statistics for prepared queries, e.g., query syntax, average elapsed time, and number of invokations.
  15. 15. Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 15 Query Monitoring 15
  16. 16. Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 3 COUCHBASE IMPORT/EXPORT TOOLS 16
  17. 17. Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 17 CBImport 17 ‘cbimport' is a new tool to import data into a Couchbase cluster from different data sources. In 5.0, cbimport supports importing data from CSV file or JSON documents. • Each supported format is a sub-command of the cbimport tool • ‘cbimport csv’: Imports data into Couchbase from a CSV file • ‘cbimport json’: Imports data into Couchbase from a JSON file • ‘cbimport' tool also supports custom key-generation for each document in the imported file. Key generation is done with a combination of pre-existing fields in a document and custom generator functions supplied by cbimport. • ‘cbimport' tool supports importing JSON document of different structure • JSON object on each line, • files that contain a JSON list (that is array) where each element is a document, • and the Couchbase Samples files
  18. 18. Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 18 CBExport 18 ‘cbexport' is a new tool to export data from a Couchbase cluster. In 5.0, cbexport supports exporting JSON data to a file. • Each supported format is a sub-command of the cbexport tool • cbexport json: Exports JSON data from Couchbase to a file • cbexport tool supports exporting JSON document of different structure • JSON object on each line, • files that contain a JSON list (that is array) where each element is a document, • Couchbase Samples files
  19. 19. Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 4 COUCHBASE WEB CONSOLE 19
  20. 20. Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 20 Couchbase Web Console 20 Goals of the redefined CouchbaseWeb Console - • To maximize the usability of the existing features • Revise sitemap, visual design, and navigation • Increase UI power & flexibility. • Update frameworks; optimize UI design • Responsive design - make better use of screen real estate • Expand the feature set. • Incorporate new Spock features; better utilize current REST calls for monitoring, notification, etc
  21. 21. Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 21 Couchbase Web Console 21
  22. 22. Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 5 DEMO !!! 22
  23. 23. Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. THANK YOU! 23

×