Jump to content

Opinion on mixing RDBMS and NoSQL into single project

Trinopoty

How do you people feel about mixing RDBMS (say MySQL) and NoSQL (say Mongo or Cassandra or whatever but not Redis) into a single project?

Has anyone done it and what pros or cons does it provide?

And if you are against it, why?

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, doertedev said:

Microservices is all the rage - mix and match as you please. But beware: use things for what they're built for. You're just wildly mixing technology types here!

-> Use Kafka as an append-only log.

-> Use an RDBMS when not only you have a schema but it also makes sense.

-> Redis and Memcached are plain in-memory KeyValue stores. Dont cluster Redis. Be careful when needing this persisted.

-> Don't use mongodb. Just.... Don't!

-> Cassandra is a time series DB. It should be used as such.

But go ahead and experiment with the technologies - become fond of running them in prod and seeing where the turning knobs are when scaling. 

I know when and where to use the different technologies (mostly).

Let's assume a monolithic application with a partial schema that stays fixed and a part of it that's not fixed and may change radically in the future.

Would using the two technologies to store the two parts of the data make sense?

 

Also, why do you advise against Mongo? Everyone seems to be losing their shit over Mongo and here I see you advise against it.

Link to comment
Share on other sites

Link to post
Share on other sites

19 minutes ago, Trinopoty said:

I know when and where to use the different technologies (mostly).

Let's assume a monolithic application with a partial schema that stays fixed and a part of it that's not fixed and may change radically in the future.

Would using the two technologies to store the two parts of the data make sense?

 

Also, why do you advise against Mongo? Everyone seems to be losing their shit over Mongo and here I see you advise against it.

I have many projects running with both pg and some other NoSql database (influx, firebase, redis, memcached, solr, ES, you name it). Having an all-in-one database might simplify your infra, but will give you lots of headaches when trying to do some specific things.

FX6300 @ 4.2GHz | Gigabyte GA-78LMT-USB3 R2 | Hyper 212x | 3x 8GB + 1x 4GB @ 1600MHz | Gigabyte 2060 Super | Corsair CX650M | LG 43UK6520PSA
ASUS X550LN | i5 4210u | 12GB
Lenovo N23 Yoga

Link to comment
Share on other sites

Link to post
Share on other sites

You perfectly can mix and match. People generally use sql to store the important stuffs and then use no sql to store whatever that are not as critical like say remembering the last item a customer visited at an e commerce store.

 

Don't listen to people telling you not to use xyz. If it's a personal project, you can choose whatever technologies you are most comfortable with and if you are doing this for a job, you will be force to use whatever the company is using so not like you get to decide. 

Sudo make me a sandwich 

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, Trinopoty said:

How do you people feel about mixing RDBMS (say MySQL) and NoSQL (say Mongo or Cassandra or whatever but not Redis) into a single project?

Has anyone done it and what pros or cons does it provide?

And if you are against it, why?

From what I read, a lot of widely deployed web applications use DBs of mixed paradigms anyway. Don't think that you have to have one database. Use multiple DBs if your application benefits from having such.

Link to comment
Share on other sites

Link to post
Share on other sites

I have used a mix of MySQL and Mongo in a project at work and, at first, I liked it quite well. But over time, I kept running into lots of cross DB transaction issues.

Now I'm considering moving it to MySQL only because I never need to query any of the document data in Mongo other than with the primary key or whatever it's called.

Link to comment
Share on other sites

Link to post
Share on other sites

I don't have any experience with NoSQL db's.  I am however a big believer in the philosophies of

Quote

Premature Optimization is the Root of all Evil

&

Keep it Simple Stupid

To be clear, I don't have anything against either NoSQL db's, or RDMS', but it is usually worth being sure that whatever difficulty you'll have to go through (including any potential bugs you might introduce, or obfuscating your code and making it harder to manage in the future) are going to be worth it.

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×