Y
Y
yiicoder2016-02-03 16:39:47
Java
yiicoder, 2016-02-03 16:39:47

What language to choose for the Backend of a highly loaded rest service?

Backend tasks - rest service for games (social/mobile).
The tasks are trivial - to take the data from the database, transfer it to the client, receive a request from the client, execute simple logic, save it in the database, send the response.
!!The load is high, 150k-300k RPM, create somewhere between 30-50k users online - the usual average for us. Now the whole thing keeps PHP in several nodes. With the release of the 7th version, of course, we were glad, but now we are completely planning to go to a compiled language with static typing.
The main goal is to keep as much RPS from the node as possible.
A brief overview of what we consider:
Most of all I like GO in terms of working with a large number of connections. Goroutines are beauty. But some cons specifically kill the pros.
C#, the whole infrastructure is on Linux, so apparently Mono. There are a lot of exclamations that all this is not for production. (Although we work with Mono on the client)
C ++ is fine, but I really don’t want to deal with memory management myself.
Java - to be honest - no experience, we tried to deal with threads: honest threads obviously eat a lot of server RAM, "cheap" implementations of coroutines are frighteningly heavy (is it possible somehow else?).
What language (+framework) do you use for such tasks and why?

Answer the question

In order to leave comments, you need to log in

8 answer(s)
E
evnuh, 2016-02-03
@evnuh

Well, you don't have much choice.
Go - orders of magnitude easier, especially when working with your tasks (http/json/db)
C++ - many times faster than Go, but it will also be much harder for you to work with it
As long as you don't have millions online and you live on PHP, go easy on Go, it will last a long time.

U
uvelichitel, 2016-02-03
@uvelichitel

If the logic is simple (scripted in Lua), then nginx with the LuaJit module does not seem to be faster.

A
Alexander Taratin, 2016-02-03
@Taraflex

C++ is great, but I really don't want to deal with memory management myself.

vibed.org

L
LittleFatNinja, 2016-02-03
@LittleFatNinja

piso

S
Stanislav Makarov, 2016-02-03
@Nipheris

pick up data from the database, transfer it to the client, receive a request from the client, execute simple logic, save it in the database, send the response

According to your description, the DB should be the bottleneck. And if there are a lot of nodes with a base, why not multiply the backend servers?

X
xmoonlight, 2016-02-03
@xmoonlight

I advise you to stay on PHP and connect Redis
for the time being. Your problem is not in processing, but in storage.

M
Maxim Grekhov, 2016-02-11
@Sterk

Vote for C#. Yes, it's not as fast as C++. But he's pretty fast. If you are going to release a new version by the summer or later, you can look at the new asp.net core mvc. there are benchmarks on github (just don't look at asp.net mvc 5, it's dull in this regard). At the bottom of the page there is "Plain Text with HTTP Pipelining", which I think is very revealing. Yes, so far Linux is sagging (while still being faster than node.js, which is faster than php), but this is a matter of time. Regarding the fact that the rock is still faster, two months ago asp.net core gave out 200-300k in these tests (on windows). For the future (a year or two), Microsoft will compile to native code on different platforms (so far this only works on HelloWorld).

A
Alexey Akulovich, 2016-02-11
@AterCattus

300K RPM (5000 qps) can be kept on any of the proposed EPs on one node, if carefully and with an understanding of the features of the selected option. Well, except that I'm not sure about C# Mono.
Given your goals of "go there, process the response, calculate that, respond to the client", choosing Go would be very helpful.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question