Home / Companies / Couchbase / Blog / March 2018

March 2018 Summaries

25 posts from Couchbase

Filter
Month: Year:
Post Summaries Back to Blog
A web application developer explores the creation of a cryptocurrency exchange using Node.js and Couchbase, diving into cryptocurrency exchanges' functionalities, such as managing Bitcoin transactions and user accounts. The developer, who is not an expert in the financial sector, shares a step-by-step guide on setting up a Node.js application, configuring dependencies, and building a database and Bitcoin logic. This includes generating hierarchical deterministic (HD) wallets, creating transactions, and setting up RESTful API endpoints using the Express framework. Despite the comprehensive walkthrough, the author acknowledges potential security concerns, such as the need for encrypting sensitive data and the limitations of using Couchbase for financial applications due to its lack of strong durability and consistency features. The article underlines the importance of testing and securing the application, while inviting feedback and collaboration from the community to improve the approach.
Mar 28, 2018 5,990 words in the original blog post.
In a microservices architecture, making synchronous calls only can lead to cascading failures due to the lack of guarantees on service availability and response time. Asynchronous communication is generally recommended, but it requires careful consideration of issues such as network instability, high latency, or temporary unavailability of services. To address these challenges, frameworks like Netflix's Hystrix provide a set of patterns, including local caches, timeouts, retries, circuit breakers, bulkheads, etc., to prevent cascading failures. However, this approach can add unnecessary complexity to the system. An alternative is the Service Mesh pattern, which externalizes this complexity in a sidecar container and provides standardized metrics, making it language agnostic and easier to manage. Choosing an inappropriate database for a microservices system can also lead to poor performance and high costs. Specialized storage solutions like NoSQL databases offer benefits such as higher performance, lower cost, and improved scalability. Finally, debugging and observability in a distributed system require careful planning and consideration of tools like Event Sourcing/Logging, which can help identify issues and provide insights into the system's behavior.
Mar 27, 2018 1,201 words in the original blog post.
Couchbase Server 5.5 introduces full support for geospatial search, enabling developers to create applications that leverage location-based data. This post demonstrates the implementation of geospatial capabilities through a web-based UI, using Couchbase Full Text Search to create a simplified version of Yelp for hotels. The project utilizes .NET Core with Aurelia for the frontend, integrating Google Maps to visualize search results. Two primary geospatial search methods are implemented: bounding box and distance search, which allow users to find points of interest within defined areas or radii. Despite a known bug in the .NET SDK affecting geopoint field retrieval, a workaround is provided by using document keys for secondary lookups. The post emphasizes the seamless integration of Couchbase's geospatial indexing with ASP.NET Core REST endpoints, allowing developers to focus on UI and business logic while relying on Couchbase for the computational aspects of geospatial search.
Mar 23, 2018 2,264 words in the original blog post.
Every internet-connected device requires an IP address, but the limited number of IPv4 addresses is insufficient for the growing number of devices, prompting the adoption of IPv6, which offers a vastly larger address space. Couchbase Server 5.5 introduces IPv6 support to address this issue, requiring users to configure each node in a cluster for IPv6 operation, with specific steps for Linux platforms. Transitioning from IPv4 to IPv6 in Couchbase can be complex, and the recommended approach for users is to establish a new cluster with IPv6 and use Cross Datacenter Replication (XDCR) to migrate data, as IPv4 and IPv6 clusters cannot pair for bi-directional replication. Users are encouraged to try the IPv6 feature in Couchbase Server 5.5's developer build, which is meant for non-production environments and may contain bugs.
Mar 22, 2018 632 words in the original blog post.
Daniel Ancuta introduces a Python tool using geospatial queries with Couchbase REST API and Couchbase Full Text Search to search a database of cities. The tool allows users to load data from a CSV file, insert it into a Couchbase bucket, and perform searches by name, coordinates, or distance. The code is written in Python 3.6.4 and uses Couchbase Enterprise Edition 5.1.0 build 5552. It covers the basics of geospatial queries, Couchbase setup, data loading, and search functionality. The tool provides a basic framework for more advanced applications, such as serving data through a CLI or REST API, improving data loading performance, and exploring other features like faceting and sorting.
Mar 22, 2018 1,256 words in the original blog post.
Alberto Marchetti, a full-stack developer, outlines a method for creating a distributed timed-tasks system using Couchbase and Go, leveraging Couchbase's indexing and locking features to manage task execution in a multi-node environment. The system allows tasks to be scheduled with an execution time specified in milliseconds, using a distributed architecture to prevent multiple workers from processing the same task by employing pessimistic locking. The proposed solution involves querying the database for tasks ready to be executed, locking them for processing, and then deleting them upon completion. Marchetti discusses the use of Couchbase's CAS (Check and Set) feature to ensure document version integrity and optimize task processing with query-specific indexes. He also addresses the potential for further enhancements, such as error handling and retry mechanisms, to improve system reliability. This approach demonstrates a scalable way to manage timed tasks across distributed systems, with practical code examples and considerations for multi-node setups.
Mar 19, 2018 1,767 words in the original blog post.
Couchbase Server 5.5 introduces index partitioning, a feature that enhances indexing capabilities by allowing the distribution of index load across multiple nodes using hashing, which complements the existing method of creating index replicas. This approach facilitates balanced index scan loads, improves performance by enabling parallel query execution on each partition, and supports partition elimination for faster query responses without increased latency. To implement index partitioning, users must specify fields for partitioning, ideally immutable ones, to minimize partition skew and reduce latency through efficient query alignment with index partitions. However, this feature is exclusive to the Enterprise Edition, and users are encouraged to explore its benefits by downloading the Couchbase Server 5.5 release and engaging with the community through forums for further inquiries and feedback.
Mar 19, 2018 817 words in the original blog post.
Couchbase Server 5.5 introduces enhanced auditing capabilities for N1QL actions, building on the general audit functionality initiated in version 5.0, but only available in the Enterprise edition. This auditing feature allows administrators to monitor data access, crucial for sensitive information, by tracking which N1QL statements are executed and by whom, although it does not support record-level auditing as it logs statements rather than individual records. Auditing is configured through the Couchbase Admin console, where administrators can specify which types of statements to audit, manage log files, and whitelist trusted users to reduce log entries. The system supports two types of events for auditing: N1QL statement types and API requests, with forward filtering added in version 5.5 to enhance efficiency by letting the query engine send only relevant audit records to the audit demon. Additionally, audit records, stored as JSON files, can be imported into the database using the cbimport utility, allowing for further analysis and querying, although selectivity by document characteristics is not supported.
Mar 19, 2018 2,695 words in the original blog post.
Kubernetes (K8s) has become a popular topic among web developers due to its capabilities in managing containers, load balancing, and automating application deployments. While managing stateless containers is relatively straightforward, handling stateful applications is more complex, which is addressed by Kubernetes' StatefulSets that provide resources like volumes and stable network IDs. These resources support both ephemeral and persistent storage, with the latter ensuring data persists independently of a Pod's lifecycle. Kubernetes Operators, introduced as custom controllers, have revolutionized application management by automating administration tasks and integrating with the Kubernetes API to monitor and adjust clusters. This has been particularly impactful for databases, traditionally difficult to manage, with the Couchbase Operator leading the way by automating cluster provisioning and scalability. The introduction of Operators is rapidly expanding, promising a cloud-agnostic future where cloud providers might become interchangeable based on performance and cost, significantly benefiting developers. Recent updates include the Couchbase Autonomous Operator 1.2 and advancements in Local Persistent Storage and Operator Hub, further enhancing Kubernetes' capabilities.
Mar 19, 2018 1,283 words in the original blog post.
The text provides a comprehensive guide on using the Couchbase Analytics Service (CBAS) with Node.js, highlighting its capacity to efficiently handle complex queries on large datasets using a SQL-like syntax. The document outlines steps to configure a Couchbase Analytics dataset by creating a shadow dataset from the travel-sample bucket in the Couchbase Administrative Dashboard, and subsequently demonstrates how to execute queries within a Node.js application using the Couchbase SDK. It explains the initialization of the analytics service, setting up the project environment, and running queries through a Node.js script, emphasizing that while CBAS and SQL++ are not replacements for N1QL, they complement it by handling larger, more complex datasets. The guide concludes by encouraging further exploration of Couchbase 5.5 features and the Node.js SDK through the Couchbase Developer Portal.
Mar 19, 2018 820 words in the original blog post.
Document conflicts in distributed environments, particularly mobile settings with unreliable network connections, can arise when multiple devices update the same document concurrently. Couchbase Mobile 2.0 addresses this with "Automatic Conflict Resolution" or "Conflict-free" mode, which automatically handles conflicts, eliminating conflicting revisions in the database. This system utilizes a default conflict resolver, obviating the need for developers to manually address conflicts, unless they choose to be notified and take specific actions. The mode employs a "Last Write Always Wins" policy as default, although a "Fail On Conflict" option is available for developers who wish to be notified of and manage conflicts manually. The conflict-free approach reduces database size by minimizing the need to store older revision metadata. The Sync Gateway in this version ensures no conflicting revisions by rejecting those causing conflicts, with handling occurring client-side during pull replication. While this mode simplifies conflict management, it raises concerns about data loss in offline scenarios, prompting discussions about potential enhancements for custom conflict resolution.
Mar 19, 2018 4,522 words in the original blog post.
To leverage Couchbase Analytics, developers can prepare shadow datasets against a bucket using simple commands from the Analytics query console. These datasets are then initialized by connecting to the Bucket and executing specific commands. With the Java SDK, developers can create applications that query massive amounts of data using SQL++ queries without worrying about indexing, resulting in fast and efficient results. The Couchbase Developer Portal provides additional resources for learning more about developing with Java and utilizing the new features available in the Couchbase Server 5.5 release.
Mar 16, 2018 803 words in the original blog post.
The latest release of Couchbase Server 5.5 introduces several key indexing improvements, including partitioned indexes that enable automatic splitting and spreading of index nodes across multiple smaller nodes, reducing the need for manual splitting and improving performance. Additionally, aggregation pushdown to indexes allows for faster N1QL queries by pushing down aggregations like COUNT, SUM, MIN, MAX, AVG along with GROUP BY, while the new "ALTER INDEX" command simplifies administration by providing a declarative way to move indexes between nodes. The revamped Index Administration Console offers better readability and visual cues, and new REST endpoints provide insights into index usage parameters, enabling administrators to monitor and optimize their indexes more effectively.
Mar 16, 2018 1,006 words in the original blog post.
Couchbase Analytics Developer Preview 4 introduced the capability to manage Analytics nodes directly from the Couchbase Server administration console, with Couchbase Server 5.5 further streamlining the installation process. The installation involves downloading the developer build, setting up a new cluster through the admin console, configuring the necessary services, and assigning memory quotas. After setting a name and password for the cluster, users can install the Analytics service, view running services via the Dashboard, and add data like the "beer-sample" bucket. Users can verify the setup by executing a simple query in the Analytics workbench and are encouraged to explore the new features through the Couchbase Analytics tutorial, with opportunities for engagement and feedback through the Couchbase forums.
Mar 16, 2018 288 words in the original blog post.
The Couchbase Eventing service allows developers to create functions that can detect changes in documents as they happen, enabling real-time monitoring of sensitive information such as social security numbers. This feature is available as part of Couchbase Server 5.5 and can be used to trigger notifications when sensitive data is detected. To use the Eventing service, a developer must set up two buckets and configure a whitelist for outgoing requests. A function can then be created using N1QL queries to detect changes in documents and send notifications to an API endpoint. In this example, the function checks if a document contains a social security number and sends a notification if it does. The Eventing service is intended for development purposes only and should not be used in production environments.
Mar 14, 2018 984 words in the original blog post.
The Couchbase Sync Gateway is a key component of the Couchbase Mobile stack, which facilitates secure data routing and synchronization between web and mobile clients and the Couchbase Server using a REST API. For developers working with the Sync Gateway, Postman offers a practical tool for API testing, development, and documentation, supporting collections for both Admin and Public interfaces. Recent enhancements to the Sync Gateway Postman Collections and Postman itself are discussed, including instructions on importing collections, running mock requests, and testing against a live Sync Gateway instance. The post underscores the utility of features like request chaining, which allows for dynamic updating of environment variables, and the generation of code snippets and documentation via Postman. Developers are encouraged to contribute enhancements or raise issues through the GitHub repository, and the post provides avenues for further engagement and support.
Mar 13, 2018 1,187 words in the original blog post.
The Couchbase Server 5.5 release introduces a new feature called "Log Redaction", which allows users to redact sensitive information from logs, such as Personally Identifiable Information (PII) and internal asset data, in compliance with data-related regulations like HIPAA, PCI, and GDPR. Log redaction can be enabled via the UI or CLI, with default settings starting at 'none' and allowing for more levels of redaction to be added in the future. The feature post-processes system logs to identify and scramble sensitive data using a one-way hash function, while still leaving non-redacted versions on local disks for troubleshooting purposes.
Mar 13, 2018 536 words in the original blog post.
The Couchbase Eventing Service, part of the Couchbase Data Platform 5.5, introduces a new offering called Couchbase Functions that enables server-side functions triggered by events in real-time. This service brings compute closer to data and allows customers to process changes as they happen, providing an interface to consume changes using the Database Change Protocol (DCP). Couchbase Functions is designed to be easy to use, with an online JavaScript code editor for developing and debugging code on generated mutations to the data residing in a Couchbase cluster. It offers developers a platform to concentrate on business logic, making deployment of rules as easy as possible. This paradigm enables the development of deeply engaging user experiences based on real-time events. The service solves several requirements, including notifications before expiry, threshold-based monitoring and alerting, propagating changes to other systems, enriching content in near-real time, triggering routines on documents at specified intervals, and cascade deletes. It targets asynchronous, stateless, low-latency workloads and emphasizes business logic over configuration or infrastructure. The service offers a powerful tool for developers, leading to high development velocity and agility. It integrates with the Chrome Debugger for real-time debugging and provides multidimensional scaling, allowing for independent scalability of compute workloads.
Mar 10, 2018 1,040 words in the original blog post.
Couchbase Server 5.5 introduces several new querying features aimed at enhancing flexibility and performance, including ANSI JOINs, HASH joins, and aggregate pushdowns. ANSI JOINs now allow more standard-compliant syntax and greater flexibility by removing previous constraints, while HASH joins can improve performance for certain types of joins by constructing an in-memory hash table, although these require explicit invocation and are available only in the Enterprise Edition. Aggregate pushdowns improve the performance of aggregation operations by enabling the index service to handle grouping tasks, significantly reducing execution time when indexes are properly utilized. The release aims to provide a more natural experience for users familiar with relational databases and includes various examples to demonstrate the practical application of these new features using the "travel-sample" dataset.
Mar 09, 2018 1,602 words in the original blog post.
Couchbase Server 5.5 introduces end-to-end compression, allowing data to stay compressed throughout its journey from client to cache, disk storage, and replication across data centers, which is particularly beneficial given that most customer data is in compressible JSON format. The data flow begins with the client application sending data through SDKs to a managed cache, which prioritizes memory storage and then persists data to disk. Data is also replicated within and across clusters using the Database Change Protocol (DCP), which supports lossless recovery and efficient processing. Compression options include storing data in compressed form on disk and during replication, with the choice of compression mode offered to users. This feature is advantageous for enterprises using public clouds like AWS, Azure, or GCP, as it reduces storage, network, and memory costs, particularly during large-scale data replication. The system is designed to optimize efficiency based on various factors, though measuring the exact compression achieved can be challenging due to the variability in document sizes.
Mar 08, 2018 787 words in the original blog post.
Couchbase Server 5.5 Developer Build introduces exciting new features and enhancements aimed at improving agility, performance, and manageability based on customer feedback. Key highlights include the addition of two new services: the Eventing Service, which allows real-time processing of data changes, and the Analytics Service, enabling real-time analysis of JSON data without the need for ETL processes. The update also supports ANSI joins in N1QL for seamless migration from RDBMS and improved data modeling, along with substantial performance enhancements, such as aggregate optimization and index partitioning. Other notable improvements include enhanced data compression, deployment and management through Kubernetes, auto failover for increased reliability, extended security compliance features, and response time observability for monitoring application performance. These enhancements underscore Couchbase's commitment to delivering a robust and efficient data platform, with additional resources and documentation available for developers to explore these features further.
Mar 08, 2018 1,483 words in the original blog post.
Here's a neutral and interesting summary of N1QL in one paragraph: N1QL is a query language used for interacting with Couchbase NoSQL databases, allowing developers to retrieve and manipulate data efficiently. To start using N1QL, it's recommended to take the free training or experiment with it to get familiar with its syntax and capabilities. Common scenarios include selecting documents by type, joining tables, and querying arrays within documents. When writing queries, understanding how indexes work is crucial, as they can significantly impact performance. Additionally, developers need to be aware of pagination, consistency issues, and the importance of creating optimized indexes, especially for array fields. By mastering N1QL, developers can unlock the full potential of their Couchbase databases and build high-performance applications.
Mar 06, 2018 856 words in the original blog post.
The article describes a shell script designed to automate the setup and configuration of Couchbase Server clusters within Docker containers, aiming to simplify a complex process. The script, written in Bash, allows for flexible configuration through parameters and defaults, enabling the creation of a Couchbase cluster by handling tasks such as configuring parameters, starting instances, and setting up ports and services. It supports integration with other scripts for Sync Gateway setup and demonstrates how to use environment variables and command-line inputs for configuration. This tool, showcased in a demonstration application developed for Couchbase Connect 2017, offers a streamlined approach to managing Couchbase environments, with the code available on GitHub for further exploration and use.
Mar 06, 2018 859 words in the original blog post.
SUMMARY: ANSI JOIN provides much more flexibility in join operations in Couchbase N1QL, compared to previously supported lookup join and index join. The examples above show various ways you can use ANSI JOIN in queries. Since ANSI JOIN is widely used in the relational world, the support for ANSI JOIN in Couchbase N1QL should make it much easier to migrate applications from a relational database to Couchbase N1QL.
Mar 05, 2018 7,060 words in the original blog post.
XDCR is a high-performance asynchronous data replication system used to replicate data between Couchbase clusters across different data centers, primarily for high availability, disaster recovery, and data locality. It is trusted by several Fortune 500 companies for mission-critical applications and can be tuned for optimal performance through advanced settings accessible via the Couchbase Administrator Console and supported APIs. Key tuning considerations include factors such as data nature, mutation rate, cluster workload, and network configuration, which can influence performance. Experiments conducted demonstrated how adjusting settings like Source and Target Nozzle, Batch Count, Batch Size, and Optimistic Replication Threshold can enhance throughput or conserve network bandwidth, although variations in test results may occur due to AWS cloud environment dynamics. Users are encouraged to experiment with these settings but are advised to consult with Couchbase for specialized or critical use cases, with guidance offered by Solution Engineer Nirvair Singh.
Mar 03, 2018 612 words in the original blog post.