Skip to main content
6 votes
Accepted

Long running REST API in PHP, async?

You need two applications. Your website simply saves the job to a database or queue. your worker application picks jobs up from the queue, does them and write the result back to the database.
Ewan's user avatar
  • 84.6k
5 votes
Accepted

What does it mean to be "truly" asynchronous?

Here it just means that while the I/O operations themselves may be asynchronous, the completion events are dispatched synchronously in Windows (ie, when you check the completion port). UNIX signals ...
Useless's user avatar
  • 12.9k
5 votes
Accepted

Does it make sense for an API with 1 daily job to do to be asynchronous?

Think of this as two distinct responses. A response to the initial request and then a response to the result. The result response will not be on the initial request. When ordering fast food, you have ...
Jon Raynor's user avatar
  • 11.8k
5 votes

How to separate sync and async methods in C# type?

Should I add async methods to the same file in a #region Async? Never. #region is a bandaid. You're better off taking the time and refactoring things well, or splitting them off into components. Even ...
Telastyn's user avatar
  • 110k
5 votes

How to separate sync and async methods in C# type?

If you're going the async route, you want consumers of your interface to use the async version in order to realize any benefit. So it makes most sense to just get rid of the sync methods from the ...
casablanca's user avatar
  • 5,004
5 votes
Accepted

Achieving very large real-time async writes on MySQL tables without locking them to reads

Before guessing that it will be slow you actually have to demonstrate that it's slow. This is in the fundamentals of performance optimization Hundreds of thousands of users, times game count for each ...
Silviu-Marian's user avatar
4 votes

How to separate sync and async methods in C# type?

Suffix is all you need If you've chosen to expose both async and non-async methods, the way to distinguish between them is with the async suffix. For example, Find() and FindAsync() provides ...
John Wu's user avatar
  • 27k
4 votes

How to separate sync and async methods in C# type?

I would go a pure async route because this is what you usually want and provide sync methods via extensions since they are only wrappers/decorators. I would not use #regions for this purpose. Too ...
t3chb0t's user avatar
  • 2,601
3 votes

Does it make sense for an API with 1 daily job to do to be asynchronous?

I am under the impression that the strength of an asynchronous API is that it can handle multiple requests at once, leading to less request timeouts. Not exactly. A synchronous API can also handle ...
JimmyJames's user avatar
  • 31.1k
3 votes

Does it make sense for an API with 1 daily job to do to be asynchronous?

If caller should be able to monitor status of the task and be able to find out whether final result (eg. completed or failed), you can: return response with status code 303 and Location header status ...
user470365's user avatar
  • 1,259
3 votes
Accepted

Designing persistence guarantees in an ingestion pipeline with a non-customizable intermediary

VictoriaMetrics ingestion path is built to process data in a streaming fashion for performance reasons. Data is accepted as a stream and re-processed (conversion to internal structs and applying user-...
hagen1778's user avatar
  • 146
3 votes
Accepted

Asynchronous HTTP request pattern

Are these two patterns the correct way to process asynchronous HTTP requests? They are a correct way to process asynchronous HTTP requests. The representation sent with this response ought to ...
VoiceOfUnreason's user avatar
3 votes

How to sync async and await Tasks?

You need a lock that allows you to await it rather than block. This functionality is offered by the SemaphoreSlim class. SemaphoreSlim _semaphore = new SemaphoreSlim(1); async Task ...
John Wu's user avatar
  • 27k
2 votes

Does placing an httpd server in front of a Vert.x application defeats Vert.x's purpose?

The C10K problem is the issue: Apache creates processes and threads to handle additional connections. The administrator can configure the server to control the maximum number of allowable processes. ...
2 votes

Should I create two synchronous or a single asynchronous rest APIs?

With a timeframe of days or weeks you may want to think about what happens if there is a failure while waiting for the confirmation. If you want this to just work and be resilient to the host process ...
Jason Weber's user avatar
2 votes

Should I create two synchronous or a single asynchronous rest APIs?

An API may be synchronous where low latency is a requirement and asynchronous where data or service availability and connectivity are low. So I would suggest doing it asynchronously because as you say ...
Sebastian Sotto M.'s user avatar
2 votes

Is microservices architecture a good candidate for a pipeline?

I have a monolithic application which can be divided into multiple steps and different steps have variable scaling requirement This has nothing to do with a state machine. This is a pipeline. You ...
sevensevens's user avatar
2 votes

Designing persistence guarantees in an ingestion pipeline with a non-customizable intermediary

Given that you are verifying a migration of old data rather than live streaming ingesting current data I think you can do it by adding an extra step. Although this might fail your "built in" ...
Ewan's user avatar
  • 84.6k
2 votes
Accepted

What are the approaches for joining data in distributed processing

About the name of such a system I can't say anything - I'd guess that it's not a specific name but a function of the system, which I would informally call event consolidation. Regarding the behavior ...
Hans-Martin Mosner's user avatar
2 votes
Accepted

Synchronisation of different "channel" in an asynchronous way

Mostly what a message broker buys you is the ability to publish to a topic without having to keep track of the subscribers. Message brokers don't magically speed you up. In fact, they add some queuing ...
Karl Bielefeldt's user avatar
1 vote

Changes that aren't changes (The AAA problem)?

Most likely this is undocumented behavior. Many systems automatically update date/time on update columns and many times this functionality is not well documented, although it is expected from a ...
Jon Raynor's user avatar
  • 11.8k
1 vote

Can multiple producers cause events with the same key to be enqueued out of order within a specific partition of a topic?

Kafka stores events (with the same key, assuming your producers use the default partition assignment strategy) in a partition in the order with which they arrive. Think of it as an append-only log. If ...
Benissimo's user avatar
  • 111
1 vote

Is microservices architecture a good candidate for a pipeline?

Separating them into individual services so that they can scale independently - good idea. For real-time responses, adding requests to the message queue will not help - you are right. Network latency ...
skott's user avatar
  • 509
1 vote

Is it good approach to await async tasks in object destructor?

The primary reason for asynchronous task-like objects to have their destructors wait on the completion of the task is not so that someone can easily write an "asynchronous" task that immediately ...
Nicol Bolas's user avatar
  • 12.1k
1 vote

Is it good approach to await async tasks in object destructor?

Is it good approach to await async tasks in object destructor? Personally I would answer that question with "No". The reason for that answer is simple: This question shouldn't ever arise. If you run ...
Mecki's user avatar
  • 2,390
1 vote

How to separate sync and async methods in C# type?

Install Zomp.SyncMethodGenerator Write your async method with [CreateSyncVersion] decorator All your code will be nicely source generated under dependencies => analyzers Example: The following ...
Victor Irzak's user avatar
1 vote

Structural problem related to Dependecy Injection and Asynchronous Operations

Usually the way this works from the API code would be something like this: Receive request with batch of files Add files to processing queue Respond with 202 Accepted response Your core code in the ...
Berin Loritsch's user avatar
1 vote

PHP or NodeJS for a chat app with message queue

If you have people who are familiar with Node, it's a good choice. PHP can do the same stuff Node can with a couple of extensions, but Node is good at that stuff right out of the box. But frankly, ...
cHao's user avatar
  • 1,020
1 vote

Achieving very large real-time async writes on MySQL tables without locking them to reads

There is some question as to whether you need to worry about this before you have benchmarked the performance. I kind of agree but it's also the case that contention issues such as deadlocks could ...
JimmyJames's user avatar
  • 31.1k

Only top scored, non community-wiki answers of a minimum length are eligible