DEV Community

Cover image for What is your database of choice?

What is your database of choice?

Andrew Baisden on August 21, 2020

At the moment my preference is mongoDB however I am trying to get back up to speed with SQL so I can use PostgreSQL as well.

Collapse
 
mikerogers0 profile image
Mike Rogers ✈️

PostgreSQL! I used to use MySQL/MariaDB, but PostgreSQL seems to be normal choice for Rails devs, plus I have very few surprises with it.

I used MongoDB recently, while it was fun I realised how much I love having explicit migrations for DB columns.

Collapse
 
andrewbaisden profile image
Andrew Baisden

What do you use to interact with the database do you use a GUI or the CLI? I am currently trying out valentina-db.com/en/ and before that I used pgAdmin.

Collapse
 
mikerogers0 profile image
Mike Rogers ✈️ • Edited

CLI & TablePlus.

I like the CLI (e.g. the rails console) as it gives me all the stuff my apps does. I normally use TablePlus as a read only view of what's going on.

Collapse
 
abdisalan_js profile image
Abdisalan

It really depends!

ACID Transactions + clear schema and enforced relationships between schema? PostgresQL or MySQ (probably just postgres haha)

Analytics + Performance for querying business logic? A Columnar Database.

Need to store documents? MongoDB or S3

Need super high performance? Cassandra

Need just key-value store? Use CouchDB or DynamoDB if you got the $$

Collapse
 
garretharp profile image
Garret

What do you mean by if you have the money Dynamo? Dynamo is a super well priced database and its pay for what you use. Super super nice stuff.

Collapse
 
abdisalan_js profile image
Abdisalan

Good question, while it’s well priced I’ve experienced sudden spikes in price which sucked

Thread Thread
 
garretharp profile image
Garret

Weird dynamo has really stable pricing of course prices will go up with usage so if you randomly spike the database at one point it will spike but other than that you can scale it up and down without having to do anything on your end so you are always paying the lowest price possible.

Collapse
 
henry_adams profile image
Henry Adams

Switched to PostgreSQL from SQL Server.
I had nothing against SQL Server, other than the fact that it is very windowscentric. PostgreSQL is just as powerful, plus I really like notifications system.

Collapse
 
leastbad profile image
leastbad

Tell us more about PG notifications? I'd love to see an example of how it works.

Collapse
 
rhymes profile image
rhymes

It's a basic pub/sub system. The DB sends events to connected clients. You have a channel where a client can be in listening mode on and the DB or other clients can send events to. For example: tapoueh.org/blog/2018/07/postgresq...

Thread Thread
 
buinauskas profile image
Evaldas Buinauskas

To be fair for comparison, SQL Server has service broker, which does the same. It also has became available on Linux recently 👌

But both are great RDBMSes!

Thread Thread
 
leastbad profile image
leastbad

Wow, I haven't worked with SQL Server since Rails came out in 2004.

I have to say, it must have been a cold day in hell when they approved porting SQL Server to Linux. Good for them, though. The irony is that I am now back on Windows 10, running PG inside of a headless WSL2 Ubuntu VM.

Collapse
 
xowap profile image
Rémy 🤖

PostgreSQL is my choice because

  • It is well supported by the Django ORM (and the Django ORM is fantastic, especially migrations-wise)
  • It is ACID and conceptually correct
  • It has all the features I ever needed (full text search, fuzzy matching, constraints, materialized views, ...)
  • It is very widespread in managed database services (DigitalOcean, AWS, GCP, etc)
  • Despite what the Uber monkeys think, it scales
  • It has plenty of convenient types (arrays, hash maps, JSON) that let you be very flexible with how you represent your data (even get the flexibility of NoSQL when you need it)
  • And of course you can index and query those types (yes you can make an indexed query deep into a JSON field)
Collapse
 
andrewbaisden profile image
Andrew Baisden

All good reasons I can see why its so popular now looking at all of these responses.

Collapse
 
buinauskas profile image
Evaldas Buinauskas

My rule of thumb is start with any modern relationshal database such as SQL Server, PostgreSQL, MySQL and use NoSQL only when product needs very specific problem to be solved and database is designed for that specific use case

Collapse
 
rhamses profile image
Rhamses

MongoDB on side projects and Neo4j at work, but I’m looking to learn Postgree as well, many projects that I have interest to contribute with use it alongside python (which I need to practice more as well)

Collapse
 
andrewbaisden profile image
Andrew Baisden

Python and SQL thats the stack I am trying to learn right now. It seems to be very good for job prospects.

Collapse
 
rhamses profile image
Rhamses

That seems to be the choice to get into Data science and B.I stuff. I hope I start studying this soon

Collapse
 
x1unix profile image
Denis Sedchenko

PostgreSQL is my standard choice for SQL.
All other options (NoSQL) are depends on project.

Collapse
 
anders profile image
Anders

PostgreSQL, has been rock solid since the start. (Prior to that used SQL Server primarily (some real weird issues with that one)).

Collapse
 
kylebernhardy profile image
Kyle Bernhardy

Andrew,

Check out my company's product, HarperDB. It is NoSQL & SQL with a single underlying data model. So you can still execute NoSQL operations while getting up to speed on SQL. If you are interested & it fits your needs / use case you can spin up a free instance: harperdb.io/harperdb-cloud-get-sta...

Collapse
 
andrewbaisden profile image
Andrew Baisden

Cool thanks I will create an account and give it a try.

Collapse
 
nyxtom profile image
Tom Holloway 🏕

I'm still a bit sad about RethinkDB.

In any case these days my goto choice is MongoDB and PSQL (depending on the use case)

Collapse
 
skenekt profile image
Alexey Suharev

Psql

Collapse
 
garretharp profile image
Garret

DynamoDB is by far my favorite. I do not really have a need for SQL in most of the stuff I do because I do not care for analytical data.

Dynamo being serverless which means I only pay for what I use and it scales basically infinitely is just the best thing in the world too. I will admit it's hard to learn but once you know how to use it, it is super super powerful.

Collapse
 
lehmannsystems profile image
Mike

I still kinda like MySQL :P

Collapse
 
athomsfere profile image
Austin French

I had a terrible experience with Postgress, and in hindsight it was the companies wrapper that ruined anything useful a RDBMS offers.

I'd love to give it's ORDBMS a shot.

SQL Developer was, meh. It's certainly a DBA's favorite, as it requires an actual DBA as the database scales to keep it running well. And the EF drivers aren't as easy to use.

SQL Server has all around been my favorite. It probably always will be, until a relational database isn't required at least.

Collapse
 
pavelsevcik profile image
pavelsevcik

AragoDB for NoSQL / documents / graphs, it also includes search engine and V8 powered micro-services engine, all of that significantly simplifies devops

Collapse
 
eduwr profile image
Eduardo Wronscki

PostgreSQL

Collapse
 
leob profile image
leob

MySQL ... I've also used PostgreSQL in the past and TBH I think it's a toss-up, either one does not seem hugely better than the other.

Collapse
 
mostajeranmohammad profile image
Mohammad Mostajeran

Postgres

Collapse
 
meseta profile image
Yuan Gao

Postgres is my RDB of choice, but if the situation demands it. mongo for noSQL, Redis for in-mem data and pub/sub, elasticsearch for full-text search. These are the four I use most often

Collapse
 
mikenikles profile image
Mike

That depends on the use case. I currently use ClickHouse (clickhouse.tech) to record immutable events.

For user data, settings and other application data I use FaunaDB (fauna.com).

Collapse
 
gac profile image
Igor Ilic

Depends on the type and the size of a project.

For smaller or less complicated projects I'd use MySQL

But for larger or complicated projects I'd use MS SQL Server

Collapse
 
yannbrrd profile image
Yann Barraud

Mongo is overrated AFAIC. PosgreSQL & ArangoDb,which is underrated... 😃

Collapse
 
tomlienard profile image
Tom Lienard

I use MySQL/MariaDB for small websites, but I prefer MongoDB for larger ones and for Java applications. I often use Redis to cache data too

Collapse
 
terabytetiger profile image
Tyler V. (he/him)

I've done a little bit with Firebase and enjoyed it.

At work I've been using CouchDB because of it's integration with PouchDB.js in our Vue Apps and really enjoy the experience!

Collapse
 
djnitehawk profile image
Dĵ ΝιΓΞΗΛψΚ

+1 for mongodb
never going back to sql ;-)

Collapse
 
sakshatshinde profile image
Sakshat

Depends on the project :p

Collapse
 
ddm50 profile image
Din

MongoDB of course, I was very hesitant to start using it but man did it pay off...