Answer the question
In order to leave comments, you need to log in
What language to choose for api server?
Good day.
I ask for your help and advice, I started the project, and I am doing a web part for it.
There are servers on which everything will stand.
I can’t choose for myself the language/languages in which to write the site and the api service (
You need to write two parts:
A site for users.
Api server that will respond to requests from the site, they will be available only to the site itself, users will not even know about them
Requirements: The
site will be viewed by users, and do all sorts of things, it should be as fast as possible.
Api will perform resource-intensive tasks: calculations, writing from the database to a file and vice versa, and other functions that the site cannot withstand. Api must be multi-threaded, there can be no talk of any asynchrony, it must be able to process a lot at once.
Writing everything in one place is not suitable. many sites will access the api server.
From the beginning, I started writing like this:
A site in PHP - which was accessed by
Api users in C # - which received requests from the site and responded to it.
But to be honest, I didn’t like this bunch at the very beginning, I don’t know why.
The site and the api server can communicate using any protocol, as long as it is convenient to implement it in the selected languages. In the case of what I wrote, they simply communicated, the API accepted and returned JSON.
Here is an approximate diagram of how everything should be arranged:
The database of the site (the one on top) can be, in principle, any, as long as it is fast.
Though it is more preferable MySQL for very much got used to it.
Thanks and I look forward to your help.
Answer the question
In order to leave comments, you need to log in
1. For serious computing, you may need a whole cluster + ***MQ for queuing.
2. For long-term / large-scale calculations - php is not quite a cake. PHP Hypertext Processor, but for some reason a lot of people forget about this fact.
3. C++ is worth using if you can justify why)).
4. In principle, I recommend looking towards Golang.
The site will be viewed by users, and do all sorts of different things. it should be as fast as possible.
Basically you are creating 2 separate applications. Both applications can be written in the same language, if you like / know PHP - write everything in it. Use queues to perform time-consuming resource-intensive tasks. In any case, using different technology stacks (PHP and .NET) without good reason is not rational at the same time, it is better to work in the same stack.
The site will be viewed by users, and do all sorts of different things. it should be as fast as possible.
What you know how to write on. And how fast it will work depends on how well you do it.
But if you need to calculate something very serious, then it's probably better to choose python (django) / ruby (onrails)
Perhaps these are quite fast options.
Demon in C (any) is also a fast option with the right approach
I just had an idea to write a module for nginx, tell me how crazy it is.
I would also not mind accepting something like php with inserts in c / c ++. It seems convenient and productive, but still not what you need (
You can do this with python, ruby. Then something might work out, but if you already write in c++, then everything at once.
Website - AngularJS
API - PHP/C#/Node - whatever is more convenient.
I think you've dug too far and are in too much of a hurry.
Start over with a problem statement - what do you want to do?
You will be advised how best to do it.
I suspect that for the first year or two, even one server will be enough for you,
well, the maximum is to place the SQL server on a separate piece of iron.
Write in C Sharp and don't worry. by the way that I asynchronously and multithreaded did not understand. in most cases, async is more than enough, or will the live video be processed there?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question