Support for JavaScript remains a priority for us at Couchbase–and during the Couchbase ConnectONLINE 2021 event last year, where we discussed how we evolved our support for JavaScript over the past year. This blog post will summarize the JavaScript-related takeaways from Connect 2021, specifically our support for Ottoman, Next.js, and Ionic.

Ottoman.JS

At Connect, Arun Vijayraghavan (Principal Product Manager at Couchbase) and Eric Bishard delivered a basic walk-through of the Ottoman.js project. They explained why using an object data mapper (ODM), like Ottoman, to build Node.js applications for a NoSQL database like Couchbase is ideal. In addition, they demonstrated Ottoman in action and shared what was coming next.

What is Ottoman Node.js ODM? 

Ottoman is an Object Document Mapper (ODM) library for Couchbase and Node.js that maps JSON documents stored in Couchbase to native JavaScript Objects used to build modern web applications. Ottoman is powered by the Couchbase Node.js SDK and has built-in support for JavaScript and TypeScript.

Why use Ottoman?

  • Adaptability – Ottoman is written in JavaScript and TypeScript.
  • Supportability – Couchbase provides enterprise customer support for Ottoman.
  • Sustainability – Ottoman is a fully maintained project that is frequently upgraded to match the current state of the art with Couchbase server and the underlying SDK.
  • Affordability – Ottoman is open-source software, so it is free to use and improve!

Ottoman features

Some of the salient features of Ottoman include:

  • Query Builder – Designed to build N1QL queries in a native, flexible, secure, and N1QL – agnostic way!
  • Hooks – Maintain data integrity with document lifecycle events.
  • Schemas and Models – Easily define a JavaScript Object Model to become your data model with the help of Schemas and Models.
  • Immutable – Protect data from accidental updates.
  • Timestamps – Automatically manage audit fields in every document.
  • Custom Data types – Flexibly create real-world data representations using custom data types.
  • Constraints and Custom Validators – Reduces risk and provides data accuracy with constraints and custom validators.

What is next for Ottoman? Couchbase has several initiatives underway to extend data quality by adding field-level encryption, enhancing Management and Query Builder APIs to expand test coverage, and adding GraphQL plugins to support GraphQL API.

If you are interested in learning more about Ottoman JS + Couchbase Cappella, you can check out the following links:

Ionic + Couchbase Lite

At Connect, Matt Netkow (Head of Product & Solutions Marketing at Ionic) discussed how you could build offline-enabled mobile apps with Ionic and Couchbase Lite.

Organizations want multi-platform experiences across web, mobile, and desktop along with offline capabilities. However, building these multiplatform experiences requires significant investment in maintaining separate codebases and hiring large developer teams with distinct skills. This is where Ionic fills in the gap. Couchbase Lite helps by offering a full-featured embedded NoSQL DB for cross-platform apps that is offline first, highly secure, and provides peer-to-peer sync. 

Ionic is a leading cross-platform development solution that powers ~15% of apps in app stores with a user base of 5 million developers worldwide. With the Couchbase Lite integration to Ionic, developers can build highly secure, offline enabled, cross-platform applications.

If you are interested in learning more about Ionic + Couchbase Lite, you can check out the following links:

Next.JS + Couchbase

Next.js is a Jamstack framework built by Vercel that empowers developers to build server-side rendered web apps by combining the powerful flexibility of React with the speed and SEO benefits of statically generated websites. 

At Connect, Elliot Scribner (Developer Advocate at Couchbase) discussed the advantages of using Next.js with Couchbase before walking through a demo app leveraging Next.js, Couchbase and Vercel deployment.

Adding dynamic functionality on the client-side can be challenging with such apps. Next.js solves some of these issues with powerful tooling for the Node.js environment, but developers still need a way to store their data.

Couchbase offers several advantages that make it highly complementary with Next.js:

Flexibility & Scalability – flexible schema that is always available and consistently performant.

  • Easily add data points without re-writing your entire schema
  • High availability and consistent performance

Interact with your data – mix and match several access methods to fit your needs. 

  • Directly access documents with Key/Value operations
  • Write N1QL queries for more complex data operations
  • Search through text and/or geographic location with Full-Text Search

Manage with Ease – Built-in web console and out of the box replication and scaling

  • Access all configuration from an easy-to-use web UI
  • Grows with your application’s needs

Together, Couchbase and Next.js are a formidable pair–both offer straightforward installations to get your app up and running quickly.

If you are interested in learning more about Next.js + Couchbase, you can check out the following links:

____________________________________________________________________________

Thank you for reading this post and catching up on some of the latest Couchbase JavaScript-related developments. You can watch the entire set of Couchbase Connect 2021 presentations on YouTube.

Author

Posted by Vinai Amble

Product Marketing Manager

Leave a reply