Answer the question
In order to leave comments, you need to log in
How to create node js multi-server architecture?
I am a novice developer on the js stack, I want to make a parser for 3 Chinese sites and it seems to me that one server will not be able to cope
. , and the 3rd one and they all write to one database.
There is supposedly a main server and it takes data from the database.
If those 3 servers write to one database, will it not fly?
Answer the question
In order to leave comments, you need to log in
My experience suggests that just all Applications can live on one server, you can even run several instances of the same application to increase the speed of downloading information, but the results for saving in must be in different databases.
If we consider the Application, then it represents a cycle:
- URL generation (usually fast)
- HTTP request (very slow)
- Parsing (fast)
- save to the database (slow)
i.e. most of the time the application will wait for an HTTP request and save to db.
so you can run as many applications as you have enough memory.
Judging by the volumes (Alibaba), one server for the database is clearly not enough, and for the database to work quickly, it needs a lot of free RAM.
If using a MySQL database, then there is an ARCHIVE Engine that is configured for fast insertion. There are limitations, but you can always set up replication to InnoDb or wherever you need.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question