A
A
Andy Vo2015-04-22 01:13:18
PHP
Andy Vo, 2015-04-22 01:13:18

Which language to choose for the server side of a highload project?

Good day.
There is a big project and I had the honor to rewrite its logic.
The goal is this:
Make all calculations, records, etc. regarding the logic of the project separate from everything else. So that the web and mobile versions would simply send requests to the logical part and it would perform all the basic operations.
I’ll say right away that the main contenders are Python and NodeJs.
I looked at various statistics and somewhere python, somewhere nodejs is better.
The project requires good performance with low resource consumption (the server is powerful, don't think about it). There will definitely be a large number of calls to the PostgreSql database.
I don’t know which language and framework to choose for such needs.
A friend is pushing me to write everything in C ++ and the idea is not bad in principle, but I'm worried about the speed of development and the stability of the project.

Answer the question

In order to leave comments, you need to log in

8 answer(s)
Y
Yuri Yarosh, 2015-04-22
@voidnugget

When people call 1Gbps of dynamic http traffic a highload, it makes me smirk rather absurdly.
Comparing php / python / ruby ​​is more or less worthwhile since they are fully interpreted languages ​​with bytecode caching, sometimes with optimizations, as is the case with jRuby and Project Graal. Usually such things die at 14-17K requests per second with empty responses ... In general, on one gigabit of traffic, everything usually ends here. Node.js in terms of performance is more correctly compared with JVM languages ​​like Groovy or Scala, but not with Java itself. In practice, through Netty on Disruptor under offheap and Terracotta, you can skip even 40Gb of live traffic, without static - the main thing is to correctly profile and write directly pfRing.
In almost every case where there is garbage collection, offheap caching, or any other methods of controlling heap growth, should be used. During the build itself, in very large (16GB or more) old generations, problems arise with schedulers and priority control - as a result, we get a very large, critical increase in the current delays for processing requests.
If you want to build something really worthwhile, you should look towards CQRS-ES and reactive applications within SOA. It is possible to introduce microservice architectures if there are no requirements for delays in query execution. But given that you are asking here questions about "which is better node.js or python" I don't think you have enough experience to build such things.
You can try golang - Yandex tears from python to golang because of its slouchness, and tears are pretty good. Golang now has the best RAD, much cooler than the same node.js. The idiomaticity of the language itself solves quite a lot of potential problems at the development stage. And the community is now quite actively sawing its runtime - they are introducing multi-threaded gc and a couple of other goodies. Even without knowing all these asynchrony and other crap with golang, you can get a pretty good exhaust. True, the lack of normal datamappers and scaffolding under golang confuses me a little.

X
xmoonlight, 2015-04-22
@xmoonlight

php - everything will be in the best possible way if the hands are "straight".

K
KorsaR-ZN, 2015-04-22
@KorsaR-ZN

If there is a choice between Python and NodeJS, definitely take Python, in NodeJS you suffer with its asynchrony.
C++ is certainly good, but in my opinion it will greatly slow down the development speed, and you can run into memory leaks.
So, take Python, although you can take a closer look at PHP and the Phalcon framework
. In general, it is difficult to advise something without knowing the approximate load.

I
index0h, 2015-04-22
@index0h

With a node, it is very likely that you will suffer from memory leaks. A node is certainly not a bad thing, but you should understand that N database query threads are limited, where N is the number of CPUs (in case you don’t use the cluster module, N = 1). As far as IO is concerned, the node is very synchronous.
As for C++ - be careful, development speed and support will probably be a sore point.
I won't say anything about Python.
You can look towards Golang or Java.
Generally speaking, you can't select a technology based on a couple of abstractions like "work with postgre", "project logic", "highload")) It's like guessing a password knowing that it was written on a yellow piece of paper. Too little information.
As for HL: maybe I will say a controversial thing, but if you are guided by HL - do not even assume that there will be one server.

V
Viktor Vsk, 2015-04-22
@viktorvsk

10k a day is not a load. Symphony is clearly no worse than dzhanga or express. If it "slows down", put down indexes in the database and tweak the settings (in your case, it seems to me, start at least with pg_tune)
If it continues to slow down, then no gestures, especially rewriting into unknown languages, without a profiler - find out the bottlenecks and set c) specific questions.
And, of course, clarify the concept of "brakes". You never know, maybe your scripts and styles are not merged and compressed and everything is running in a dev environment

M
Mikhail Osher, 2015-04-22
@miraage

I beg of you. Symphony people handle a billion requests a week .
Properly design logic, database, caching, balancing - everything will fly.
And technology doesn't make much of a difference. The main thing is your skills.

B
bromzh, 2015-04-22
@bromzh

Choose Java

F
Fedor Lapshin, 2019-02-14
@FedLapshin06

Better Go!
1. Multi-threaded (uses cores and threads, as in NodeJS)
2. Asynchronous
3. Many libs (and for the Internet too)
4. A bunch of gadgets out of the box
5. Cross-platform
6. Compiled

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question