Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Array cache using Yii3 cache library #19980

Closed
wants to merge 2 commits into from
Closed

Implement Array cache using Yii3 cache library #19980

wants to merge 2 commits into from

Conversation

mtangoo
Copy link
Contributor

@mtangoo mtangoo commented Sep 25, 2023

Q A
Is bugfix?
New feature?
Breaks BC?
Fixed issues 19979

@what-the-diff
Copy link

what-the-diff bot commented Sep 25, 2023

PR Summary

  • An Addition to Required Dependencies
    The software's dependency list has been updated to include "yiisoft/cache", a necessary tool for improving data management and speed.

  • Introduction of ArrayCache Functionality
    A new feature known as 'ArrayCache' has been added. This is a locally held temporary space for data, which significantly enhances the speed and efficiency of data storage and retrieval.

  • Upgraded Methods for Better Data Management
    Numerous methods have been modified to utilize this new 'ArrayCache' feature:

    • 'exists': Checks if a specific piece of data is available in the cache.
    • 'getValue': Gets the required data from the cache.
    • 'setValue': Stores data into the cache.
    • 'addValue': Adds new data into the cache, but only after checking if it already exists to prevent duplication.
    • 'deleteValue': Deletes the specified data from the cache.
    • 'flushValues': Clears out all data from the cache.

These modifications make data operations faster and improve overall application performance.

@mtangoo mtangoo requested a review from a team September 25, 2023 20:58
@mtangoo mtangoo self-assigned this Sep 25, 2023
@mtangoo mtangoo added this to the 2.2.0 milestone Sep 25, 2023
@bizley
Copy link
Member

bizley commented Sep 26, 2023

What are the benefits of using this package?

@mtangoo
Copy link
Contributor Author

mtangoo commented Sep 26, 2023

What are the benefits of using this package?

For this array one not really anything significant. But given the plan is to move whole Yii2 caching to use Yii3 packages under the hood, that gives big advantages in terms of quality and easy to maintain.

@rob006
Copy link
Contributor

rob006 commented Sep 26, 2023

Cache in Yii2 is quite mature and does not need that much of the maintenance. This approach also does not really help people to prepare their apps/libraries for Yii 3, which AFAIK was the main goal of Yii 2.2.

@mtangoo
Copy link
Contributor Author

mtangoo commented Sep 26, 2023

Cache in Yii2 is quite mature and does not need that much of the maintenance. This approach also does not really help people to prepare their apps/libraries for Yii 3, which AFAIK was the main goal of Yii 2.2.

I picked the list from #19875
To the best of my knowledge, no body objected it. Can we move tempoarily the discussion as to which libraries there merit the effort, if we are not going to replace all of them?

Another question [That I believe is valid to conitinue discuss here] would be, after Yii3 is fully adopted and before Yii2 is fully unsupported, will there be enough maintainers to fix issues like PHP version compatibility or new language feature as they come and go? IMHO, having as many Yii3 library under the hood will easy this whole burden as Yii3 libraries will be upd-to-date with language feature set/compatibility
Take it as a Yii1 thing of today.

@rob006
Copy link
Contributor

rob006 commented Sep 26, 2023

From my understanding #19875 was not about using Yii3 packages through decorators, but using them directly, so people could switch to new API and easier migrate to Yii3.

@mtangoo
Copy link
Contributor Author

mtangoo commented Sep 26, 2023

So basically, assuming that you understood it correctly, PR should be about new Cache API (Yii3 api Actually) for Yii2 with Yii3 cache package replacing Yii2 caching everywhere in the framework itself. Is that correct?

@rob006
Copy link
Contributor

rob006 commented Sep 26, 2023

I'm not entirely sure how to handle this, but I don't think that hiding Yii3 implementation behind decorators with Yii2 API is worth the effort - it is probably more work than maintenance of old implementation, and as a result you only get bugs and BC breaks. If Yii 2.2 is supposed to be a bridge between Yii 2.0 and Yii 3, then we should focus on that, not on refactoring.

@mtangoo
Copy link
Contributor Author

mtangoo commented Sep 26, 2023

I'm not entirely sure how to handle this, but I don't think that hiding Yii3 implementation behind decorators with Yii2 API is worth the effort - it is probably more work than maintenance of old implementation, and as a result you only get bugs and BC breaks.

I agree that I got this wrong. I think that is clear now

If Yii 2.2 is supposed to be a bridge between Yii 2.0 and Yii 3, then we should focus on that, not on refactoring.

How is the bridge supposed to look like? I think we have not done a good job defining this one. We need somehow to reach clear resolution on definition of the bridge. What entails the bridge a part from language bar and removing deprecations due to old stuffs?

@mtangoo mtangoo closed this Sep 28, 2023
@mtangoo mtangoo deleted the 2.2 branch September 28, 2023 05:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants