-1

I want to test Node and Deno and try to redirect users via proxy to one MySQL DB.

How will it impact the database?

Can some timestamp conflicts via CRUD operations arise or does MySQL have some mechanism to cope with connections from multiple servers?

What about performance or memory footprint of the database in RAM? Will it be occupying the same amount of space as if there was only one server requesting the database to CRUD something?

What would happen if I added another server that will connect to the DB, for example, java or Go server?

Gergejs
  • 33
  • 5
  • 1
    Timestamps normally are generated by the db. Having multiple connections from different clients is a common use case for db cluster but be awar the MySQL is not ACID compliant (see: https://dba.stackexchange.com/questions/177569/is-mysql-acid-compliant). The programming language of the client doesn't matter for the DB. About your RAM part, this is hard to tell without knowing anything about your load. I'd recommend testing it and see it with real workloads and adjust machine configuration accordingly to fit your workload. – bemeyer May 21 '20 at 10:28
  • Thank you. What does the ACID compliance mean in real world examples? I am not a big corporation. My use case is that users write and edit rows of their own posts and only the admin (from another app/server) can edit their records at the same time. It's mostly POST requests like 98% of time. It's not a real time app, the worst thing that can happen is to have the same primary key like id of a post when posting things at the same time or something. But I think that is handled by the MySQL internally, right? – Gergejs May 21 '20 at 10:51
  • POST is an HTTP requests and not related to sql queries on your database. So I assume you mean that your application will transform the http request to a writing query to your database. Please see the following link on [How do ACID and database transactions work?](https://stackoverflow.com/questions/3740280/how-do-acid-and-database-transactions-work) to get an understanding of what it means if you have multiple clients using your database. – bemeyer May 21 '20 at 10:58
  • It was just to illustrate that I do mostly READs and not WRITEs in the DB. That's why I chose MySQL instead of PosgreSQL. Posgres is more fashionable right now but MySQL is less memory hungry for reads than PosgreSQL. If I had to do more writes I would select Posgres and you can do more with weaker hardware. Do you have some one or two sentence exaplanation about the acid stuff?Is there some table or graph to illustrate those things in real world situations like memory, CPU, req/s, etc.? – Gergejs May 21 '20 at 11:41
  • The RAM consumption of RDBMS is depending on a lot of factors like query complexity, join sizes and much much more. Noone can give you a clear answer to this. As said I'd recommend testing it and adjust your machine to it no matter if you use MySQL or PostgreSQL. – bemeyer May 21 '20 at 11:50
  • Do you think there could be a problem with some duplicate indices in tables due to the fact that two projects are asking to do the same thing from the database? Or the database infrastructure thinks about these cases that could happen and there is a mechanism, some queue of sort that automatically take care of these things. If theoretically two persons did everything at the same time what would happen, etc. – Gergejs May 21 '20 at 11:51
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/214332/discussion-between-bennx-and-gergejs). – bemeyer May 21 '20 at 11:51

1 Answers1

0

It will virtually have no impact on the database other than having any other concurrent processes connecting to it.

This is not a deno issue but rather a database issue.

The exact same problems can happen even with your current single Node.js instance, because the nature of all systems these days is concurrent/parallel.

You might as well replace the Deno app with another Node.js instance, Java, etc. Or even your current Node.js app.

Data in a database can change once you loaded it to the client, and it is up to you to implement the code that will handle such scenarios.

The fact that MySQL is not "ACID" is neither negative nor relevant in and of itself because it is doesn't have context.

If you need complete absolute integrity on a registry make sure you lock it when you select it, but there will be a trade off.

Evandro Pomatti
  • 13,341
  • 16
  • 97
  • 165