Can I do transactions and locks in CouchDB?

No. CouchDB uses an “optimistic concurrency” model. In the simplest terms, this just means that you send a document version along with your update, and CouchDB rejects the change if the current document version doesn’t match what you’ve sent. It’s deceptively simple, really. You can reframe many normal transaction based scenarios for CouchDB. You do … Read more

Cassandra port usage – how are the ports used?

@Schildmeijer is largely right, however port 7001 is still used when using TLS Encrypted Internode communication So my complete list would be for current versions of Cassandra: 7199 – JMX (was 8080 pre Cassandra 0.8.xx) 7000 – Internode communication (not used if TLS enabled) 7001 – TLS Internode communication (used if TLS enabled) 9160 – … Read more

Non-Relational Database Design [closed]

I’ve only just started with non-relational DBs, and I am still trying to wrap my head around it and figure out what the best model would be. And I can only speak for CouchDB. Still, I have some preliminary conclusions: Have you come up with alternate designs that work much better in the non-relational world? … Read more

MongoDB lookup when foreign field is an array of objects

You can use below aggregation with mongodb 3.6 and above db.resources.aggregate([ { “$match”: { “type”: “FUNC” } }, { “$lookup”: { “from”: “initiatives”, “let”: { “id”: “$_id” }, “pipeline”: [ { “$match”: { “$expr”: { “$in”: [“$$id”, “$ressources.function”] } } }, { “$unwind”: “$ressources” }, { “$match”: { “$expr”: { “$eq”: [“$ressources.function”, “$$id”] } } … Read more

How to stop insertion of Duplicate documents in a mongodb collection

Don’t use insert. Use update with upsert=true. Update will look for the document that matches your query, then it will modify the fields you want and then, you can tell it upsert:True if you want to insert if no document matches your query. db.collection.update( <query>, <update>, { upsert: <boolean>, multi: <boolean>, writeConcern: <document> } ) … Read more

Storing time-series data, relational or non?

Definitely Relational. Unlimited flexibility and expansion. Two corrections, both in concept and application, followed by an elevation. Correction It is not “filtering out the un-needed data”; it is selecting only the needed data. Yes, of course, if you have an Index to support the columns identified in the WHERE clause, it is very fast, and … Read more

tech