Is MongoDB is BASE database? - database

Is MongoDB is BASE database? many articles wrote that MongoDB is acid database at document level but they not mentioned anything about that it base database or not, so I need to know about that if MongoDB is base database and support your answer with references.

MongoDB as typical noSQL database is generally identified as BASE database , since from its earlier versions allow eventual consistency and it is ACID compliant only per single document , but since version 4.0 it support multidocument ACID transactions at replicaSet level , and since version 4.2 it support multidocumet ACID transactions at sharding cluster level.So developers can choose based on application and project requirements how to configure and use the database. Some more details from the vendor you can check here

Related

PostgreSQL vs MongoDB for performing python functions in Django app

I am trying to build a Django web app, and I'm not sure what database to use. It's really important to be able to perform python functions on the data and to have a high degree of data manipulation possibilities, with relatively fast-changing data(every day or every other day). Having made previous research it seems like PostgreSQL and MongoDB might be the contenders but I am really eager to hear your opinion. Thanks!
What About Database Structure?
PostgreSQL:
PostgreSQL is an object-relational database management system (ORDBMS) with an emphasis on extensibility and standards compliance. PostgreSQL is ACID-compliant, transactional, has updatable and materialized views, triggers, and foreign keys. It also supports functions and stored procedures.
PostgreSQL uses tables, constraints, triggers, roles, stored procedures and views as the core components that you work with. A table consists of rows, and each row contains a same set of columns. PostgreSQL uses primary keys to uniquely identify each row (a.k.a record) in a table, and foreign keys to assure the referential integrity between two related tables.
PostgreSQL also supports many NoSQL features as well.
MongoDB:
MongoDB uses JSON-like documents to store schema-free data. In MongoDB, collections of documents do not require a predefined structure and columns can vary for different documents.
MongoDB has many of the features of a relational database, including an expressive query language and strong consistency. However, since it is schema-free MongoDB allows you to create documents without having to create the structure for the document first.
A useful comparison with relational database management systems (RDBMS) in which you have:
Table | Column | Value | Records.
In comparison, in MongoDB you have:
Collection | Key | Value | Document.
This means that collections in MongoDB are like tables in RDBMS.
Documents are like records in a RDBMS. Documents can easily be modified by adding or deleting fields without having to restructure the entire document.
Which Database Is Right For Your Business?
PostgreSQL: PostgreSQL seems to be gaining more popularity. If you're looking for a solution that is standard compliant, transactional and ACID compliant out of the box and has wide support for NoSQL features, then you should check out PostgreSQL.
MongoDB: MongoDB can be a great choice if you need scalability and caching for real-time analytics; however, it is not built for transactional data (accounting systems, etc.). MongoDB is frequently used for mobile apps, content management, real-time analytics, and applications involving the Internet of Things. If you have no clear schema definition, MongoDB can be a good choice.

Schema based multi-tenancy with hibernate on MS SQL Server

I'm implementing a multi-tenancy capable application based on Java 8, Spring Boot 2 and JPA/Hibernate 5
There are different approaches to this, I chose the schema based approach. The Hibernate docs also write about support for this.
I also looked at some tutorials
But it seems like everyone on the net uses native SQL to switch schema. Not only do I have to support multiple DBMS - but I could provide different implementations - but it seems like MS SQL Server does not support setting a schema for the duration of a connection only.
There is a setSchema(String) method on the JDBC Connection object, but MS does not support it (also verified by looking at their source on Github). Not only that, but I can't find a way using T-SQL either.
Is there another way to set the connection schema in my ConnectionProvider, or do I have to switch to a completely different approach (e.g., discriminator column based)?
FYI, the schemas have to be dynamic, since tenants can be created via the UI.
IMHO, the best multi-tenant strategy for your application requirements, would have been COLUMN DISCRIMINATOR strategy ... But it's still under development and not available with the last Hibernate 5.3.2 release.
FYI, the schemas have to be dynamic, since tenants can be created via the UI.
Using schema strategy with this high portable requirements is very hard to implement for some reasons:
Schema concepts are very different across database vendors
Hibernate multi-tenant solution is yet very light
I suggest, you lower your portable requirements and choose only database vendors giving you the tools for effective multi-tenant schema strategy.

Aster Data belongs to which Database family

I know Aster Data leverages SQL Map Reduce, ncluster and analytic capability.
From Database architecture perspective which family does Aster belongs to?
Aster database doesn't formally belong to certain database family, but you can identify it with several database types:
it's distributed, parallel, relational database;
it's MPP (massively parallel processing) database;
it's based on PostgreSQL open source code (forked);
it's NOT based on Teradata database.
I do not know exactly about right name, but it is sharded db, what means one Queen server and several workers with running postgres instances.
Agree with topchef. Hope the below gives you some high level information.
The database is built on top of Postgres similar to other databases like Netezza and Greenplum.
Asterdata is built on postgres but in a distributed manner.
It has something called vproc's which are similar to a standalone postgres db instance.
A Node (worker) will have multiple vprocs and all the nodes are co-ordinated using a Queen node (Master).
Though its built on Postgres, not all features of postgres are ported to Asterdata because of the distributed nature of the system.

What nosql database is ideal to use for storing code/snippets?

I want to store code similar to how jsfiddle stores code. I currently use Postgres for my main database but I'm wondering if it's more ideal to be using a NoSQL database?
Code snippets for now will have just one author, but in the future there may be multiple authors and I want the ability for reverting as well.
I know there are key/value databases and document-oriented databases. Which specific noSQL db would suite my needs? Or should I still stick with my Postgres db?
FYI:
I'm using django
The users will be permanently stored in postgres ( I'm using openID )
You can't choose a non-relational data strategy without defining what you want to do with your data.
Relational database design comes from rules of normalization, which you can apply once you know your data alone. But non-relational database design depends on your queries more than your data.
But without knowing anything about your application, my first recommendation would be to stick with PostgreSQL. Store your code snippets in text blobs, and meta-data about the code (authorship, date, language, project, etc.) in additional columns alongside the text blob. Also you can consider using GIST indexes to allow for flexible searching.
You might also consider Apache Solr, which is technically similar to a document-oriented DBMS, though it is usually presented as a fulltext search engine.
As for NoSQL databases, the only ones I'm familiar with are XML (doesn't scale well and has bad concurrency), and local databases such as Paradox, dBase, FoxProx and Access. I would not recommend any of these.
I think that the idea that it's a NoSQL database should be a smaller factor in your decision. Consider these things instead.
Redundancy. Can you run it on two servers at the same time or does it support failover? (SQL Server, Interbase, Firebird)
Concurrency. Will you host this app on the web? How will it handle 10 concurrent operations? (PostGres, MySql, Interbase, Firebird)
Speed. How long is acceptable for a lookup or post?
Embeddability. Is this a desktop application? An embedded database can make things easier. (Local databases such as Paradox, dBase, FoxPro, Access, Interbase, Firebird or SQLite)
Portability. Desktop apps may run on Mac, Linux, Windows. (SQLite)
Sounds like a relatively uncomplicated application which could be implemented in a traditional relational database or a NoSQL without too many problems.
However if you're keeping the userbase info in PostgreSQL, it would seem simplest to just stick with that as a single storage method. Using both an SQL database and a NoSQL adds complexity, makes joining across the datasets hard (so eg. you couldn't make a query to do something like ‘list users along with their most recent document’), and makes it impossible to ensure consistency between the two datasets.
What do you get for this trouble? You want versioning. CouchDB will give you revision control, but it's questionable whether you should be using that for UI-level versioning (eg because compacting the database will lose your old versions).

What advantages does a Document-based database have over a Relational database?

For example: Microsoft SQL Server vs. CouchDB.
The main benefit for me with CouchDB is that you can access it from pretty much anywhere! What advantages does a document based database have over a relational one?
Where would a document based db be a better choice over a relational?
I wouldn't say "accessing it from anywhere" is an advantage of CouchDB over SQL Server. Both are fully accessible from a variety of clients.
The key differentiating factor is the fundamental concept of how data is persisted as tables & columns (SQL Server) versus documents (CouchDB). In addition, CouchDB is designed to leverage multiple copies with replication/map-reduce in a highly forgiving fashion. SQL Server can do the same level of fault tolerance but true map-reduce is non-existant in it (it's ability to deal with sets mimics the capabilities fundamentally however - see GROUPING SETS keyword).
You should note this post which really shows that map reduce has its place, but you need to pick the right tool for the job:
http://gigaom.com/2009/04/14/mapreduce-vs-sql-its-not-one-or-the-other/

Resources