Need advice about which tool to choose?Ask the StackShare community!
Couchbase vs Realm: What are the differences?
# Introduction
This code provides a comparison between Couchbase and Realm databases.
1. **Data Model**: Couchbase uses a JSON-based data model, offering flexibility in data structure and schema-less design. On the other hand, Realm utilizes an Object-based data model, providing easy object-relational mapping.
2. **Platform Support**: Couchbase is more versatile in terms of platform support, available on multiple operating systems, cloud platforms, and container environments. Realm, however, is primarily focused on mobile platforms like iOS and Android.
3. **Offline Sync**: Realm supports seamless offline data synchronization, enabling users to work offline and sync changes when they reconnect, which is a feature not as robust in Couchbase.
4. **Query Language**: Couchbase uses N1QL (SQL for JSON) for querying data, offering the familiarity of SQL with a JSON twist. Realm uses a unique query language optimized for mobile and IoT devices to efficiently retrieve data.
5. **Community Support**: Couchbase boasts a larger and more active community support base, providing a wealth of resources like forums, tutorials, and plugins. Realm's community, while growing, may still be considered smaller in comparison.
6. **Pricing Model**: Couchbase typically follows a subscription-based pricing model, offering various tiers based on the scale of usage. In contrast, Realm provides a free tier for development but may require payment for production-level usage.
In Summary, this Markdown code highlights key differences between Couchbase and Realm databases, including their data models, platform support, offline sync capabilities, query languages, community support, and pricing models.
We Have thousands of .pdf docs generated from the same form but with lots of variability. We need to extract data from open text and more important - from tables inside the docs. The output of Couchbase/Mongo will be one row per document for backend processing. ADOBE renders the tables in an unusable form.
I prefer MongoDB due to own experience with migration of old archive of pdf and meta-data to a new “archive”. The biggest advantage is speed of filters output - a new archive is way faster and reliable then the old one - but also the the easy programming of MongoDB with many code snippets and examples available. I have no personal experience so far with Couchbase. From the architecture point of view both options are OK - go for the one you like.
I would like to suggest MongoDB or ArangoDB (can't choose both, so ArangoDB). MongoDB is more mature, but ArangoDB is more interesting if you will need to bring graph database ideas to solution. For example if some data or some documents are interlinked, then probably ArangoDB is a best solution.
To process tables we used Abbyy software stack. It's great on table extraction.
If you can select text with mouse drag in PDF. Use pdftotext it is fast! You can install it on server with command "apt-get install poppler-utils". Use it like "pdftotext -layout /path-to-your-file". In same folder it will make text file with line by line content. There is few classes on git stacks that you can use, also.
After using couchbase for over 4 years, we migrated to MongoDB and that was the best decision ever! I'm very disappointed with Couchbase's technical performance. Even though we received enterprise support and were a listed Couchbase Partner, the experience was horrible. With every contact, the sales team was trying to get me on a $7k+ license for access to features all other open source NoSQL databases get for free.
Here's why you should not use Couchbase
Full-text search Queries The full-text search often returns a different number of results if you run the same query multiple types
N1QL queries Configuring the indexes correctly is next to impossible. It's poorly documented and nobody seems to know what to do, even the Couchbase support engineers have no clue what they are doing.
Community support I posted several problems on the forum and I never once received a useful answer
Enterprise support It's very expensive. $7k+. The team constantly tried to get me to buy even though the community edition wasn't working great
Autonomous Operator It's actually just a poorly configured Kubernetes role that no matter what I did, I couldn't get it to work. The support team was useless. Same lack of documentation. If you do get it to work, you need 6 servers at least to meet their minimum requirements.
Couchbase cloud Typical for Couchbase, the user experience is awful and I could never get it to work.
Minimum requirements
The minimum requirements in production are 6 servers. On AWS the calculated monthly cost would be ~$600
. We achieved better performance using a $16
MongoDB instance on the Mongo Atlas Cloud
writing queries is a nightmare While N1QL is similar to SQL and it's easier to write because of the familiarity, that isn't entirely true. The "smart index" that Couchbase advertises is not smart at all. Creating an index with 5 fields, and only using 4 of them won't result in Couchbase using the same index, so you have to create a new one.
Couchbase UI
The UI that comes with every database deployment is full of bugs, barely functional and the developer experience is poor. When I asked Couchbase about it, they basically said they don't care because real developers use SQL directly from code
Consumes too much RAM
Couchbase is shipped with a smaller Memcached instance to handle the in-memory cache. Memcached ends up using 8 GB of RAM for 5000 documents
! I'm not kidding! We had less than 5000 docs on a Couchbase instance and less than 20 indexes and RAM consumption was always over 8 GB
Memory allocations are useless I asked the Couchbase team a question: If a bucket has 1 GB allocated, what happens when I have more than 1GB stored? Does it overflow? Does it cache somewhere? Do I get an error? I always received the same answer: If you buy the Couchbase enterprise then we can guide you.
We implemented our first large scale EPR application from naologic.com using CouchDB .
Very fast, replication works great, doesn't consume much RAM, queries are blazing fast but we found a problem: the queries were very hard to write, it took a long time to figure out the API, we had to go and write our own @nodejs library to make it work properly.
It lost most of its support. Since then, we migrated to Couchbase and the learning curve was steep but all worth it. Memcached indexing out of the box, full text search works great.
Pros of Couchbase
- High performance18
- Flexible data model, easy scalability, extremely fast18
- Mobile app support9
- You can query it with Ansi-92 SQL7
- All nodes can be read/write6
- Equal nodes in cluster, allowing fast, flexible changes5
- Both a key-value store and document (JSON) db5
- Open source, community and enterprise editions5
- Automatic configuration of sharding4
- Local cache capability4
- Easy setup3
- Linearly scalable, useful to large number of tps3
- Easy cluster administration3
- Cross data center replication3
- SDKs in popular programming languages3
- Elasticsearch connector3
- Web based management, query and monitoring panel3
- Map reduce views2
- DBaaS available2
- NoSQL2
- Buckets, Scopes, Collections & Documents1
- FTS + SQL together1
Pros of Realm
- Good7
- Elegant API3
- Cloud Syncing3
- React Native Support2
- Strong Adoption Growth1
Sign up to add or upvote prosMake informed product decisions
Cons of Couchbase
- Terrible query language3
Cons of Realm
- No offline support for web till now1