yiisoft / yiisoft/db

Separated scheme loading from main thread.

Open
#122 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status:under discussion
Dominant language
PHP
Stars
216
Forks
51
Avg merge
3d 10h
Merged PRs (30d)
2

Description

What steps will reproduce the problem?

Schema loading on the main thread is problematic in several ways (like yii2):

  • block main thread, increase response delay
  • not really suitable for event based updates (for example after deploy)
  • cache TTL problems
    • with large TTL, the change is noticed slowly
    • with small TTL, a lot of updates are unnecessary
What is the expected result?
  • The schema load can be called at any time, regardless of the main thread
I suggests

The best solution would be to generate the table schema to PHP code (for example one class/table).

  • not require cache (no connection and loading delay)
  • generation is event-based (for example, after generating the yii3 configuration)
Q A
Version 3.0.x-dev
PHP version -
Operating system -

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files, tests, or entry points are named. Start by locating the current schema-loading path in the db repository and determine how it is invoked; done would mean schema loading can occur independently of the main thread and the proposed generated PHP schema approach is defined and verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
database
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.