August 2017 Summaries
14 posts from Couchbase
Filter
Month:
Year:
Post Summaries
Back to Blog
This tutorial explores how to build a user profile store using Golang and Couchbase Server, serving as an alternative to a similar setup previously demonstrated with Node.js. It provides a comprehensive guide to creating a RESTful API for a blogging platform, including setting up and configuring Go and Couchbase, installing necessary dependencies, and creating data structures to represent user profiles and accounts. The tutorial includes steps for implementing user registration and authentication via session tokens, maintaining user sessions with middleware validation, and managing user-specific data using N1QL queries and profile IDs. The article emphasizes the importance of secure password handling and flexible data modeling afforded by NoSQL databases like Couchbase, and concludes with suggestions for further enhancement using front-end technologies such as Angular or NativeScript.
Aug 29, 2017
2,337 words in the original blog post.
M. David Allen, a seasoned software engineer and entrepreneur, presents a tutorial on using the beer-sample dataset in Couchbase to illustrate efficient data pagination techniques. He explains the need for paging in applications, particularly when managing large datasets, using a hypothetical beer-rating app as an example. By implementing pagination, only a subset of data is sent to the user's browser, enhancing performance and user experience. The tutorial details the use of N1QL clauses—LIMIT, OFFSET, and ORDER BY—to achieve this, providing SQL-like query examples to retrieve and display data in manageable portions. Allen also addresses how to determine the number of pages in a dataset and the behavior of queries when requesting non-existent pages, highlighting the efficiency and practicality of these methods for applications and API endpoints.
Aug 25, 2017
1,631 words in the original blog post.
The blog post discusses techniques for performing aggregate grouping of data using Couchbase Server, specifically through N1QL's ARRAY_AGG function and MapReduce Views, drawing parallels to SQL functions like MySQL’s GROUP_CONCAT and SQL Server's FOR XML PATH workaround. The author shares a solution developed with a solution engineer for grouping patient documents by their doctorId, creating a collection of patients for each doctor. This method is useful for applications needing aggregated data views, such as dashboards. While the author finds N1QL's method more straightforward, they acknowledge potential performance advantages of using MapReduce. Additionally, the post provides guidance on setting up and employing these methods, referencing sample data and offering further resources for learning about N1QL and MapReduce Views. The author invites feedback and discussion from readers for potential improvements.
Aug 22, 2017
1,024 words in the original blog post.
The author of the text was experiencing issues with executing a N1QL query in their Couchbase application written in Go, despite knowing that the results existed. After troubleshooting and consulting with the Go SDK engineer, it was discovered that the issue was due to errors occurring after the query execution, which were not being caught or handled properly by the author's code. The errors were caused by a mismatch between the data type of the `Timestamp` property in the saved document and its expected type when read from Couchbase. The author's solution involved printing out error messages at different stages of their code to identify and correct the issue, highlighting the importance of handling errors thoroughly to avoid hours of frustration.
Aug 22, 2017
725 words in the original blog post.
Couchbase Server users looking to upgrade from version 4.x to 5.0 can benefit from transitioning from equivalent indexes to index replicas, which provide improved manageability. The process involves creating new index replicas with a specified number of replicas, ensuring sufficient resources are available, and then dropping the old equivalent indexes once the replicas are built and online. This migration allows N1QL queries to utilize the new replicas without application downtime, although any queries using the 'USE INDEX' directive will need updates to reflect the new index names. While both equivalent and replica indexes can coexist in version 5.0, index replicas are recommended for better efficiency. Although the version 5.1 doesn't allow increasing the num_replica without recreating the index, the ALTER INDEX feature introduced in version 5.5 provides more flexibility in changing index placements.
Aug 19, 2017
370 words in the original blog post.
Azure is where Microsoft is investing heavily, offering a range of services at competitive prices. Cloud computing involves running applications in someone else's data center, appealing to enterprises that want to focus on their core expertise rather than managing infrastructure. The concept is likened to ordering pizza, where the company handles the entire process while the customer focuses on what they do best. Many companies are moving to Azure due to its benefits, including scalability and cost-effectiveness. Signing up for Azure is straightforward, requiring only a Microsoft account and credit card information. The platform offers free services, but some features, such as Couchbase Server, require a $200 trial credit. Quotas are in place to prevent unexpected expenses, and users can request increases to their limits if needed. Overall, Azure provides an accessible entry point for those new to cloud computing, with many resources available to help get started.
Aug 16, 2017
1,055 words in the original blog post.
Legacy databases are a major obstacle to businesses meeting their ambitions for improving new customer experiences and engagement. Despite having clear ambitions, many businesses struggle with using data due to limitations in legacy database technology, which cannot support the demands of digital experiences that foster customer engagement. These experiences require agile, reliable, and scalable solutions that can handle complex, interconnected, and varied data, but legacy databases are not equipped to meet these demands. In fact, only 41 percent of organizations say they can use data in real-time, and many databases cannot even provide a user experience that occurs within a day. The inability to support new technologies such as virtual or augmented reality, the Internet of Things, and Artificial Intelligence is also a major issue, with only 19 percent of digital decision makers believing their database could fully support these technologies if implemented tomorrow. As a result, legacy databases are an impediment to true digital innovation.
Aug 16, 2017
580 words in the original blog post.
The text provides a detailed guide on how to convert a web client front-end, created using Angular, Node.js, and Couchbase, into a mobile application using NativeScript with Angular. It assumes prior completion of tutorials on setting up the backend and web front-end, and a properly configured mobile development environment for Android or iOS. The guide walks through creating a new NativeScript project, manually setting up HTML and TypeScript files for various components, and configuring Angular Router for navigation. It highlights differences in UI markup between web and mobile versions, emphasizing the use of StackLayout and other NativeScript-specific tags. The text also addresses potential issues with iOS App Transport Security (ATS) when using HTTP for local development and suggests ways to resolve them. Finally, it mentions the possibility of using Couchbase Mobile components for future development. However, the text concludes with a user reporting a problem with POST requests not working, likely due to localhost issues on Android.
Aug 15, 2017
2,341 words in the original blog post.
Couchbase Server 5.0 introduces Index Replicas, a significant improvement over the previous system of Equivalent Indexes used in version 4.x, which required manually creating identical indexes with different names to ensure high availability and load balancing of N1QL queries. Index Replicas simplify this process by allowing users to specify the number of replicas or the nodes on which they should be placed, and Couchbase automatically manages query traffic distribution and rebalancing when nodes are added or removed. This approach ensures that indexes remain online even during system failures, as any failed index scan can be redirected to another replica. The system supports both Memory-Optimized Indexes (MOI) and Global Secondary Indexes (GSI) under the Plasma engine, enhancing reliability and ease of management compared to the manual operations required for Equivalent Indexes, while all replicas remain active to aid in load balancing. Users can also manually distribute replicas using the 'nodes' parameter and can move replicas between nodes using a specific REST call, ensuring flexibility and control over the indexing environment.
Aug 14, 2017
919 words in the original blog post.
In developing web applications that store user passwords, it is crucial to hash rather than encrypt or store them as plain text, as hashing is a one-way process. This text discusses using the BCrypt library in Golang for password hashing when working with Couchbase, a NoSQL database. The BCrypt package in Go provides functions for generating a hash from a password and comparing a plaintext password with a hashed one, emphasizing the importance of setting an appropriate cost value to balance security and performance. A simple example demonstrates how to create an account structure, generate a hashed password, store it in Couchbase, and later validate a user's password by comparing it with the stored hash. The overarching message is the necessity of securing sensitive information like passwords through hashing in any database environment.
Aug 10, 2017
433 words in the original blog post.
Couchbase Mobile 2.0 introduces a new replication protocol that enhances data synchronization between clients using Couchbase Lite and the server's Sync Gateway, aiming for a more consistent view of data across local and remote databases. This updated protocol is implemented over WebSockets, offering a cleaner, faster, and more resource-efficient solution than the previous REST-based approach. The new architecture, invented by Jens Alfke, allows for full-duplex message passing, multiplexing, and request/response support, leading to reduced bandwidth and socket resource usage, which can support more concurrent connections. The replication process involves synchronizing database changes using a sequence of messages that track changes via unique sequence IDs, checkpoints, and revision histories, while automatically handling conflicts through a conflict resolver callback. The system ensures persistent connectivity through an exponential backoff algorithm for reconnections and employs heartbeat messages to detect lost connections. This streamlined protocol simplifies peer-to-peer replication and enhances the overall reliability of data synchronization in distributed systems.
Aug 09, 2017
2,648 words in the original blog post.
The text provides an exploration of using Azure Functions, specifically focusing on HTTP events, to interact with Couchbase Server. The author details their experience of setting up development using Visual Studio Preview, creating "Get" and "Set" endpoints for data retrieval and insertion, and connecting to Couchbase Server. The process involves defining data structures using C#, utilizing Azure's serverless architecture to handle HTTP requests, and configuring Couchbase settings for local development. The text further describes deploying these functions and a Couchbase cluster to Azure, including setting up application settings in the Azure portal to facilitate communication between the functions and Couchbase Server. The author emphasizes the simplicity of deploying Azure Functions with Visual Studio while highlighting considerations for production environments, such as authentication, app settings automation, and data encryption.
Aug 09, 2017
1,768 words in the original blog post.
This tutorial demonstrates how to create a user profile store API and a client front-end using Angular 11 and TypeScript. The API is built using Node.js and a NoSQL database (Couchbase). The client front-end allows users to register, login, view their blog posts, and create new blog posts. The tutorial covers the creation of the API endpoints, the construction of the Angular application, and the implementation of navigation between routes. It also provides tips for improving the project, such as adding custom CSS, form validation, and error handling. Overall, this tutorial provides a comprehensive guide to building a user profile store with Angular 11 and Couchbase.
Aug 08, 2017
2,708 words in the original blog post.
The text discusses the impact of technology on various industries, with a focus on customer experience. Couchbase's Data Dilemma research reveals that enterprises are under pressure to transform themselves, but many struggle to deliver truly unique and engaging experiences. Despite digital teams feeling the heat to improve customer experience, most projects only deliver incremental improvements, rather than revolutionary changes. The text highlights the need for organizations to move away from incremental thinking and invest in data-driven approaches to drive true transformation.
Aug 01, 2017
733 words in the original blog post.