Offline-First, Real-Time Tools for Small Businesses: How Hisab Uses CouchDB

We chatted with Chirag Moradiya to learn how CouchDB’s replication features — teemed with a custom Spring Boot integration — create the backbone for their real-time and offline-first app, Hisab. It’s a comprehensive tool for small and micro businesses that manages everything from inventory and sales to accounting, with the advantage of offline, real-time functionality. 
We learned about the architectural decisions that made CouchDB the clear database choice, and what else Chirag has paired with it.

Which of CouchDB’s distinct features have been essential to you achieving your goal(s)?

Replication and Map-Reduce Query.

How did you hear about CouchDB, and why did you choose to use it?

Real-time updates and local-first were two important considerations in the architecture. We didn’t find anything better than CouchDB + PouchDB. Firebase was there for the real-time data flow, but it was not local-first, so we chose CouchDB and have been using it for around 8 years now.

Did you have a specific problem that CouchDB solved?

Both local real-time and local-first were essential problems for us to solve.

For the folks who are unsure of how they could use CouchDB — because there are a lot of databases out there — could you explain the use case?

We use CouchDB as the main database for all the application data. In other applications we use Firestore, and earlier we used Firebase Real-time Database; CouchDB is better in terms of Performance, Scalability.

What would you say is the top benefit of using CouchDB?

Performance, as well as the unique and open replication/sync protocol.

What tools are you using in addition for your infrastructure? Have you discovered anything that pairs well with CouchDB?

1. Spring Boot Integration: We have developed a library to provide Spring Reactor APIs to interact with the CouchDB Server; which also provides repository style interfaces and abstract classes. This simplifies adding a new repository (for an entity).

2. DreamDB: It’s a middleware between CouchDB and PouchDB. It eliminates boiler-plate code to implement real-time and local-first query using CouchDB and PouchDB. It also provides a way to write documents into CouchDB in a local-first manner. DreamDB server is written in NodeJS and DreamDB Client runs on the Browser. Both communicate through a single WebSocket connection and facilitate browser communication with any number of databases — eliminating browser limits for the Max N connections. It works well with multiple browser tabs and multiple devices (mobile, desktop) of a user.

We are going to open-source both of these, so others can use them freely and contribute to add more features. But due to time constraint and having a very small team this is not done on time.

I will try working extra hours at nights and weekends to make this possible!

What are your future plans with your project? Any cool plans or developments you want to promote?

We are going to add a read-security feature to DreamDB, which is most needed in our use case.

Thank you, Chirag, for sharing your story with us and for your contributions. We’ll be following your plans and look forward to sharing your tools as they come out.

Use cases are a great avenue for sharing useful technical information; let us know how you use CouchDB! Additionally, if there’s something you’d like to see covered on the CouchDB blog, we would love to accommodate. Email us!

For more about CouchDB visit couchdb.apache.org or follow us on Mastodon: @couchdb@fosstodon.org 

2024 Apache CouchDB User Survey: Results

If you responded to the 2024 Annual Apache CouchDB User Survey one motivation may have been to get a peek into how others are using CouchDB and potentially pick up a tip. The wait is over — I’m happy to share the results and make some inferences about what has changed since our last survey. 

📕 2024 Apache CouchDB User Survey Results Executive Summary

📊 Raw results in a read-only Google Sheet

Based on the executive summary, here are the most significant and interesting trends we observed.

Adoption and Community 

CouchDB doesn’t attract quite the volume of new users it once did. However, of equal if not greater interest is that very few users plan to move away from CouchDB. The trend instead is that CouchDB’s unparalleled replication and sync features are layered with other databases that offer the querying or relational features users want to work with. 

In addition to SQL querying capabilities, framework compatibility and library availability are often cited as reasons to consider working with other technologies.

The tendency to stick with CouchDB, and to use an additional database as opposed to migrating away from CouchDB, both serve as strong indicators that CouchDB continues to correspond with a significant problem space. Conversations with the Local-First community confirm this, and we look forward to welcoming users who are new to working with CouchDB and PouchDB.

Features

It’s very clear what CouchDB does well! But you are probably more interested in the feature requests. Improved querying and indexing features topped the list, specifically SQL-like queries and requests for performance. 

WebSockets for replication and changes feed were also frequently requested, along with per-document/user permissions. Since the survey, some of these have already found themselves on the roadmap.

Documentation and Writing 

This round was interesting when it came to feedback on docs and blogs, the three most active being the Cloudant, Couch Architects and Neighbourhoodie blogs. This year, people shared specific requests in the “Documentation” section for topics they need covered in more detail or would like to learn more about. 

Writing is also a way to help users find CouchDB, and find a CouchDB ecosystem that’s up-to-date. As the second-most requested thing people would like to see on the blog, case studies can help people find CouchDB via their industry problem as well as help existing users think through different configurations. That’s why we want to pilot something new: a case study submission form that can help CouchDB users share their stories with less friction. 

If you or someone you know has an interesting CouchDB setup, pass the form along to them. We hope it can help you share your story easily, and in turn help new users decide how they use CouchDB. 

Thank you to all who shared their feedback with the project. We hope next year to share the results much more quickly and appreciate your patience.