Python
What is WAL in PostgreSQL and what is it used for?
What happens if the Kafka consumer pod crashes during message processing before committing the offset?
What is `threading.RLock`?
Why can threads in Python be useful for I/O-bound operations despite GIL?
What message brokers do you know and how do Kafka and RabbitMQ differ?
Two independent workers simultaneously check that there are more than three on-duty doctors, and each takes leave, violating the invariant. What is this problem and how to solve it?
What is `SELECT FOR UPDATE`?
Which services interacted via REST, and which through Kafka?
If there are three services and one of them is run in two replicas, how many GIL instances exist?
Where should the repository interface (port) be declared: in the logical/application layer or in the infrastructure?
How do a monolith and a distributed monolith differ?
What is a mutex?
What exactly is expected during a blocking operation, which makes threads advantageous in I/O-bound scenarios?
Why was asynchronous programming and lightweight threads/coroutines invented?
Как работает hash-индекс в PostgreSQL?
app = FastAPI() def get_db(): db = SessionLocal() try: yield db finally: db.close() def heavy_text_parser(file_id: int, db: Session): # Parsing a file that takes 5 minutes parse_and_save(file_id, db) @app.post("/upload") async def upload_file( background_tasks: BackgroundTasks, db: Session = Depends(get_db) ): file_id = save_file_to_db(db) db.commit() background_tasks.add_task(heavy_text_parser, file_id, db) return {"status": "parsing started"}
What level of transaction isolation is sufficient for a scenario with two doctors and a violation of the minimum on-duty doctors constraint?
async def get_user(user_id: int, db: AsyncSession): try: user = await db.get(User, user_id) return user finally: await db.close() return None a = await get_user(15, db) # a?
How to protect the POST payment acceptance endpoint from repeated client requests during network failures?
Есть ли downtime при Rolling Update?