SlideShare a Scribd company logo
Powering an API with GraphQL,
Golang, and NoSQL
Nic Raboy
Senior Developer Evangelist at HERE Technologies
The RESTful API
RESTful API
RESTful API with Multiple Related Endpoints
RESTful API
Nothing’s wrong with RESTful APIs, but they could be better!
RESTful API
• Too many API endpoints to remember
• Too many API endpoints to maintain
• Too much data to process
• Too large of data payloads
The GraphQL API
The Benefits of GraphQL
graphql.org
graphql.org
GraphQL
GraphQL
GraphQL
• Server to client payloads are flexible
• Client to server queries are flexible
• Minimal API endpoints to remember
Processing GraphQL in Go
GraphQL
GraphQL Data Model
GraphQL Query
GraphQL Query
GraphQL Query
GraphQL Endpoint
GraphQL cURL Request
Integrating a NoSQL Database
Couchbase: The Complete Database Solution
Infographic provided by Couchbase
22
Couchbase Lite Overview
• Cross-platform support for all major operating systems and platforms
• Built native from the ground up
• 500kb for most platforms
• 256-bit AES full database encryption
Infographic provided by Couchbase
23
Couchbase Server Overview
• Scale easily to thousands of nodes
• Consistent high performance that supports millions of concurrent users
• Flexible JSON data model
• 24x365 always-on availability
Infographic provided by Couchbase
24
Couchbase Sync Gateway Overview
• Synchronize data between Couchbase Lite and Couchbase Server
• REST, Stream, Batch, and Event APIs
• Pluggable authentication
• Fine grained user and role based access control
• Elastically scalable in real-time
Infographic provided by Couchbase
The Power of the Flexible JSON Schema
• Ability to store data in
multiple ways
• De-normalized single
document, as opposed
to normalizing data
across multiple table
• Dynamic Schema to
add new values when
needed
Infographic provided by Couchbase
Couchbase
Couchbase
Couchbase
Powering an API with GraphQL, Golang, and NoSQL
What is N1QL?
• Non-first (N1) Normal Form Query Language (QL)
• It is based on ANSI 92 SQL
• Its query engine is optimized for modern, highly parallel multi-core execution
• SQL-like Query Language
• Expressive, familiar, and feature-rich language for querying, transforming, and manipulating JSON data
• N1QL extends SQL to handle data that is:
• Nested: Contains nested objects, arrays
• Heterogeneous: Schema-optional, non-uniform
• Distributed: Partitioned across a cluster
N1QL (Expressive)
• Access to every part of JSON document
• Scalar & Aggregate functions
• Subqueries in the FROM clause
• Aggregation on arrays
Expressive, familiar, and feature-rich language for querying, transforming, and manipulating JSON data
N1QL (Familiar)
• SELECT * FROM bucket WHERE …
• INSERT single & multiple documents
• UPDATE any part of JSON document & use complex filter
• DELETE
• MERGE two sets of documents using traditional MERGE statement
• EXPLAIN to understand the query plan
• EXPLAIN SELECT * FROM bucket WHERE …
Expressive, familiar, and feature-rich language for querying, transforming, and manipulating JSON data
N1QL (Feature-Rich)
• Access to every part of JSON document
• Functions (Date, Pattern, Array, Conditional, etc)
• https://developer.couchbase.com/documentation/server/current/n1ql/n1ql-language-reference/functions.html
• JOIN, NEST, UNNEST
• Covering Index
• Prepared Statements
• USE KEYS, LIKE
Expressive, familiar, and feature-rich language for querying, transforming, and manipulating JSON data
Couchbase
Couchbase with Go
Couchbase with Go
Couchbase with Go
Couchbase with Go
Couchbase with Go
GraphQL Mutations
GraphQL Data Mutations
GraphQL Data Mutations
GraphQL Data Mutations
Closing Thoughts
Summary
• GraphQL limits the response payload
• GraphQL offers flexibility in API responses
• GraphQL cuts down the API endpoints
• GraphQL is not a substitute for backend management
• Couchbase is flexible with JSON
• Couchbase is powerful with N1QL queries
Getting Help
• GraphQL - graphql.org
• Couchbase - couchbase.com
• Twitter - @nraboy
• Blog - thepolyglotdeveloper.com
THANK YOU

More Related Content

PDF
Scala at foursquare
PPTX
Log analysis using Logstash,ElasticSearch and Kibana
PDF
Scaling with Riak at Showyou
PPT
Rolling With Riak
KEY
How does Riak compare to Cassandra? [Cassandra London User Group July 2011]
PPTX
seminar presentation on apache-spark
PDF
Building Realtime Data Pipelines with Kafka Connect and Spark Streaming
PDF
Kafka for Microservices – You absolutely need Avro Schemas! | Gerardo Gutierr...
Scala at foursquare
Log analysis using Logstash,ElasticSearch and Kibana
Scaling with Riak at Showyou
Rolling With Riak
How does Riak compare to Cassandra? [Cassandra London User Group July 2011]
seminar presentation on apache-spark
Building Realtime Data Pipelines with Kafka Connect and Spark Streaming
Kafka for Microservices – You absolutely need Avro Schemas! | Gerardo Gutierr...

What's hot (20)

PDF
Riak at shareaholic
PPTX
Elk meetup boston - logz.io
PDF
Scaling ELK Stack - DevOpsDays Singapore
PPTX
Taking a look under the hood of Apache Flink's relational APIs.
PDF
Big data pipeline with scala by Rohit Rai, Tuplejump - presented at Pune Scal...
PPTX
Hello, Enterprise! Meet Presto. (Presto Boston Meetup 10062015)
PPT
Hadoop ecosystem framework n hadoop in live environment
PDF
Solr cloud the 'search first' nosql database extended deep dive
PDF
Presto Strata Hadoop SJ 2016 short talk
PDF
Presto at Twitter
PDF
Interactive Data Analysis in Spark Streaming
PDF
Apache Pulsar Community-Jennifer
PPTX
ELK at LinkedIn - Kafka, scaling, lessons learned
PPTX
Bleeding Edge Databases
PDF
Getting started with Riak in the Cloud
PPTX
Elk meetup
PDF
HBaseCon2017 Apache HBase at Didi
PPTX
Apache spark
PDF
Case Study: Stream Processing on AWS using Kappa Architecture
PPTX
Ruby to Scala in 9 weeks
Riak at shareaholic
Elk meetup boston - logz.io
Scaling ELK Stack - DevOpsDays Singapore
Taking a look under the hood of Apache Flink's relational APIs.
Big data pipeline with scala by Rohit Rai, Tuplejump - presented at Pune Scal...
Hello, Enterprise! Meet Presto. (Presto Boston Meetup 10062015)
Hadoop ecosystem framework n hadoop in live environment
Solr cloud the 'search first' nosql database extended deep dive
Presto Strata Hadoop SJ 2016 short talk
Presto at Twitter
Interactive Data Analysis in Spark Streaming
Apache Pulsar Community-Jennifer
ELK at LinkedIn - Kafka, scaling, lessons learned
Bleeding Edge Databases
Getting started with Riak in the Cloud
Elk meetup
HBaseCon2017 Apache HBase at Didi
Apache spark
Case Study: Stream Processing on AWS using Kappa Architecture
Ruby to Scala in 9 weeks
Ad

Similar to Powering an API with GraphQL, Golang, and NoSQL (20)

PPTX
Big Data Day LA 2015 - Introducing N1QL: SQL for Documents by Jeff Morris of ...
PPTX
N1QL: What's new in Couchbase 5.0
PPTX
Developing Applications with Go and NoSQL
PPTX
Couchbase Data Platform | Big Data Demystified
PPTX
N1QL+GSI: Language and Performance Improvements in Couchbase 5.0 and 5.5
PDF
Introduction to GraphQL for beginners
PDF
GraphQL ♥︎ GraphDB
PDF
Marco Liberati - Graph analytics
PDF
“N1QL” a Rich Query Language for Couchbase: Presented by Don Pinto, Couchbase
PPTX
Query in Couchbase. N1QL: SQL for JSON
PDF
GraphQL Bangkok meetup 5.0
PPTX
Couchbase N1QL: Language & Architecture Overview.
PDF
apidays LIVE Paris - GraphQL meshes by Jens Neuse
PPTX
Introduction to GraphQL
PDF
PHP, the GraphQL ecosystem and GraphQLite
PPTX
GraphQL API Crafts presentation
PPTX
Couchbase Tutorial: Big data Open Source Systems: VLDB2018
PPTX
GraphQL - an elegant weapon... for more civilized age
PDF
N1QL New Features in couchbase 7.0
PDF
APIdays Paris 2018 - Secure & Manage APIs with GraphQL, Ozair Sheikh, Directo...
Big Data Day LA 2015 - Introducing N1QL: SQL for Documents by Jeff Morris of ...
N1QL: What's new in Couchbase 5.0
Developing Applications with Go and NoSQL
Couchbase Data Platform | Big Data Demystified
N1QL+GSI: Language and Performance Improvements in Couchbase 5.0 and 5.5
Introduction to GraphQL for beginners
GraphQL ♥︎ GraphDB
Marco Liberati - Graph analytics
“N1QL” a Rich Query Language for Couchbase: Presented by Don Pinto, Couchbase
Query in Couchbase. N1QL: SQL for JSON
GraphQL Bangkok meetup 5.0
Couchbase N1QL: Language & Architecture Overview.
apidays LIVE Paris - GraphQL meshes by Jens Neuse
Introduction to GraphQL
PHP, the GraphQL ecosystem and GraphQLite
GraphQL API Crafts presentation
Couchbase Tutorial: Big data Open Source Systems: VLDB2018
GraphQL - an elegant weapon... for more civilized age
N1QL New Features in couchbase 7.0
APIdays Paris 2018 - Secure & Manage APIs with GraphQL, Ozair Sheikh, Directo...
Ad

More from Nic Raboy (10)

PPTX
Getting Started with MongoDB using Node.js
PPTX
Marketing and Workflow Automation
PPTX
Create a Chatbot with AWS Lex, Lambda, and HERE
PPTX
Developing Amazon Alexa Skills with the Go Programming Language
PPTX
Static Site Generation with Hugo and Markdown
PPTX
Building a Bitcoin Hardware Wallet with Golang and a Raspberry Pi Zero
PPTX
Native to Hybrid and Back Again
PPTX
Developing for Offline First Mobile Experiences
PPTX
Quick and Easy Development with Node.js and Couchbase Server
PPTX
Cross Platform Storage & Sync with Couchbase and Ionic Framework
Getting Started with MongoDB using Node.js
Marketing and Workflow Automation
Create a Chatbot with AWS Lex, Lambda, and HERE
Developing Amazon Alexa Skills with the Go Programming Language
Static Site Generation with Hugo and Markdown
Building a Bitcoin Hardware Wallet with Golang and a Raspberry Pi Zero
Native to Hybrid and Back Again
Developing for Offline First Mobile Experiences
Quick and Easy Development with Node.js and Couchbase Server
Cross Platform Storage & Sync with Couchbase and Ionic Framework

Recently uploaded (20)

PDF
Nekopoi APK 2025 free lastest update
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
Digital Strategies for Manufacturing Companies
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
System and Network Administration Chapter 2
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
Understanding Forklifts - TECH EHS Solution
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Nekopoi APK 2025 free lastest update
wealthsignaloriginal-com-DS-text-... (1).pdf
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Digital Strategies for Manufacturing Companies
Softaken Excel to vCard Converter Software.pdf
2025 Textile ERP Trends: SAP, Odoo & Oracle
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Navsoft: AI-Powered Business Solutions & Custom Software Development
How to Migrate SBCGlobal Email to Yahoo Easily
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
System and Network Administration Chapter 2
Odoo Companies in India – Driving Business Transformation.pdf
Understanding Forklifts - TECH EHS Solution
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
How to Choose the Right IT Partner for Your Business in Malaysia
VVF-Customer-Presentation2025-Ver1.9.pptx
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf

Powering an API with GraphQL, Golang, and NoSQL