P
P
pandaa2020-05-04 18:34:21
Mobile development
pandaa, 2020-05-04 18:34:21

Where to write application functionality? On the client or on the server?

Implementation of a “thin” or “thick” client.

Let's say we are making an application - a feed of recommendations, which is based on a ranking algorithm that decides which posts to show and which not.

Which way to go?
There is some kind of interface on the client, and data from the database is needed to work, but before directly sending a request to the database, you also need to algorithmically calculate which posts to show and which not.

Thin client A
Get request is sent to the server. The server launches the ranking program and requests data from the database and issues a response formatted in JSON.

fat client
Do processing on the client (ranking algorithm) and immediately (from the application) query the database, while reducing server costs (due to the fact that all processing takes place on the client). After all, the algorithms on the client machine (Android / IOS) will be executed faster than waiting for the server to respond.

How do they usually do it?

Answer the question

In order to leave comments, you need to log in

6 answer(s)
X
xmoonlight, 2020-05-04
@xmoonlight

What the client should not see in the source code of the page is something on the server.
The rest is on the client.

R
Roman Mirilaczvili, 2020-05-04
@2ord

I would not shift the intellectual work that is invested in the ranking algorithm to clients.

D
Dmitry Entelis, 2020-05-05
@DmitriyEntelis

This is a very tricky question.
Thick clients usually do when the application keeps a huge cache of data for offline or poor internet conditions.
A thick client + a "simple" server is usually more expensive to develop and maintain than a thin client and a "complex" server.
From the point of view of the load, the functionality is transferred to the client when the following conditions are met:
- data processing is expensive (array sorting does not apply to this)
- there is no value in the data processing logic
- specific cases when ux performance is critical, and data processing on the client is faster than processing on the server + time for data transfer.
I think that without a very good reason to make a thick client is not necessary.

X
xoma99, 2020-05-04
@xoma99

Here IMHO, it all depends on the complexity of the calculations.
But I, as a backing developer, usually give all the calculations to a server, often it has more power.
But I repeat, we must look at the algorithms, their complexity and heaviness.
IMHO

A
Andrey_Dolg, 2020-05-04
@Andrey_Dolg

This is a server usually, but the ranking can be limited and the recalculation of the ranking will not be constant with each request, but let's just say once a day. There are quite a few optimization points. The rest you answered correctly.

P
pandaa, 2020-05-05
@pandaa

Answer from a specialist in machine learning and analysis...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question