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

Server side caching #193

Merged
merged 68 commits into from
Jul 24, 2020
Merged

Server side caching #193

merged 68 commits into from
Jul 24, 2020

Conversation

drakos74
Copy link

@drakos74 drakos74 commented Mar 30, 2020

Description

Create server side http cache, closes #128.

Changes

  • use cache interface of patron
  • create server side cache
  • accept client control headers
  • make the cache part of the route building logic
  • abstract cache for both RouteBuilder and RawRouteBuilder

@codecov
Copy link

codecov bot commented Apr 3, 2020

Codecov Report

Merging #193 into master will increase coverage by 0.11%.
The diff coverage is 75.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #193      +/-   ##
==========================================
+ Coverage   73.07%   73.19%   +0.11%     
==========================================
  Files          57       61       +4     
  Lines        3332     3652     +320     
==========================================
+ Hits         2435     2673     +238     
- Misses        835      904      +69     
- Partials       62       75      +13     
Impacted Files Coverage Δ
component/http/cache/route.go 49.20% <49.20%> (ø)
component/http/cache/metric.go 63.33% <63.33%> (ø)
component/http/middleware.go 90.83% <70.00%> (-1.90%) ⬇️
component/http/cache/cache.go 81.96% <81.96%> (ø)
component/http/cache/model.go 90.90% <90.90%> (ø)
component/http/handler.go 98.05% <90.90%> (+0.01%) ⬆️
component/http/http.go 100.00% <100.00%> (ø)
component/http/route.go 100.00% <100.00%> (ø)
component/async/kafka/simple/duration_client.go 93.75% <0.00%> (-3.13%) ⬇️
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f8ebb41...6b3f075. Read the comment docs.

@drakos74 drakos74 changed the title WIP Server side caching Server side caching Apr 4, 2020
drakos74 added a commit to drakos74/patron that referenced this pull request Apr 6, 2020
Signed-off-by: Vangelis Katikaridis <[email protected]>
Copy link

@mantzas mantzas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes are a lot and we probably need more than one session the review this.

component/http/cache.go Outdated Show resolved Hide resolved
component/http/cache.go Outdated Show resolved Hide resolved
component/http/cache.go Outdated Show resolved Hide resolved
component/http/cache_builder.go Outdated Show resolved Hide resolved
component/http/cache_builder.go Outdated Show resolved Hide resolved
component/http/cache_builder_test.go Outdated Show resolved Hide resolved
component/http/cache_metrics.go Outdated Show resolved Hide resolved
component/http/component.go Outdated Show resolved Hide resolved
component/http/route_cache_test.go Outdated Show resolved Hide resolved
component/http/route_cache_test.go Show resolved Hide resolved
@drakos74 drakos74 requested a review from mantzas April 9, 2020 09:17
component/http/route_cache.go Outdated Show resolved Hide resolved
component/http/cache_metrics.go Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
component/http/cache.go Outdated Show resolved Hide resolved
component/http/cache.go Outdated Show resolved Hide resolved
component/http/cache.go Outdated Show resolved Hide resolved
component/http/cache_builder.go Outdated Show resolved Hide resolved
component/http/cache.go Outdated Show resolved Hide resolved
@drakos74 drakos74 requested review from fpapadopou and mantzas April 15, 2020 13:13
component/http/cache.go Outdated Show resolved Hide resolved
component/http/cache.go Outdated Show resolved Hide resolved
component/http/cache.go Outdated Show resolved Hide resolved
Copy link

@mantzas mantzas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we have examples in this project it would be nice to see how the end-user will actually use the cache introduced.

component/http/route.go Outdated Show resolved Hide resolved
component/http/cache_builder.go Outdated Show resolved Hide resolved
component/http/cache_builder.go Outdated Show resolved Hide resolved
component/http/http.go Outdated Show resolved Hide resolved
drakos74 and others added 11 commits May 2, 2020 10:01
Signed-off-by: Vangelis Katikaridis <[email protected]>
Signed-off-by: Vangelis Katikaridis <[email protected]>
Signed-off-by: Vangelis Katikaridis <[email protected]>
Signed-off-by: Vangelis Katikaridis <[email protected]>
Signed-off-by: Vangelis Katikaridis <[email protected]>
Signed-off-by: Vangelis Katikaridis <[email protected]>
Signed-off-by: Vangelis Katikaridis <[email protected]>
@drakos74 drakos74 requested a review from mantzas May 9, 2020 15:53
mantzas
mantzas previously approved these changes May 14, 2020
@tpaschalis tpaschalis requested review from tpaschalis and removed request for moukoublen July 10, 2020 19:39
tpaschalis
tpaschalis previously approved these changes Jul 10, 2020
Copy link

@tpaschalis tpaschalis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some really great work mate, I'm on my second pass-through to really understand how it's all pieced together but 🚀

Since it already has one approval, and I don't think I'll have much to add, do you mind rebasing with master?

README.md Outdated Show resolved Hide resolved
@drakos74 drakos74 dismissed stale reviews from tpaschalis and mantzas via da3698c July 22, 2020 15:32
@drakos74 drakos74 requested review from mantzas and tpaschalis July 22, 2020 15:32
Copy link

@mantzas mantzas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are linting errors, can you fix them?

Signed-off-by: Vangelis Katikaridis <[email protected]>
@drakos74 drakos74 requested a review from mantzas July 24, 2020 07:22
Copy link

@tpaschalis tpaschalis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@drakos74 drakos74 merged commit 7471d01 into beatlabs:master Jul 24, 2020
@drakos74 drakos74 deleted the server-side-caching branch July 24, 2020 08:09
Stefos pushed a commit to Stefos/patron that referenced this pull request Oct 8, 2020
* beatlabs#128 cache wip implementation

Signed-off-by: Vangelis Katikaridis <[email protected]>

* beatlabs#128 adjust to patron new version

Signed-off-by: Vangelis Katikaridis <[email protected]>

* beatlabs#128 refine requirements

Signed-off-by: Vangelis Katikaridis <[email protected]>

* beatlabs#128 first iteration of server cache functionality

Signed-off-by: Vangelis Katikaridis <[email protected]>

* beatlabs#128 server route cache implementation

Signed-off-by: Vangelis Katikaridis <[email protected]>

* Add validation for brokers in kafka.NewBuilder (beatlabs#191)

Signed-off-by: Stanislav Afanasev <[email protected]>

* Add ActiveBrokers() method to Kafka AsyncProducer (beatlabs#192)

Signed-off-by: Giuseppe Mazzotta <[email protected]>

* beatlabs#128 revert sixth example main

Signed-off-by: Vangelis Katikaridis <[email protected]>

* beatlabs#128 update readme

Signed-off-by: Vangelis Katikaridis <[email protected]>

* beatlabs#128 fix linting

Signed-off-by: Vangelis Katikaridis <[email protected]>

* beatlabs#128 fix more linting

Signed-off-by: Vangelis Katikaridis <[email protected]>

* beatlabs#128 fix tests

Signed-off-by: Vangelis Katikaridis <[email protected]>

* beatlabs#128 fix tests

Signed-off-by: Vangelis Katikaridis <[email protected]>

* beatlabs#128 add vendor file

Signed-off-by: Vangelis Katikaridis <[email protected]>

* Add Route struct getters (beatlabs#195)

Signed-off-by: Alex Demin <[email protected]>

* Introduce dockertest to integration tests (beatlabs#182)

Signed-off-by: Vangelis Katikaridis <[email protected]>

* beatlabs#128 wrap up implementation

Signed-off-by: Vangelis Katikaridis <[email protected]>

* beatlabs#128 fix tests

Signed-off-by: Vangelis Katikaridis <[email protected]>

* beatlabs#128 add readme details on cache metrics

Signed-off-by: Vangelis Katikaridis <[email protected]>

* beatlabs#128 readme adjustments

Signed-off-by: Vangelis Katikaridis <[email protected]>

* beatlabs#128 finalise implementation

Signed-off-by: Vangelis Katikaridis <[email protected]>

* beatlabs#128 increase test timeout

Signed-off-by: Vangelis Katikaridis <[email protected]>

* beatlabs#128 decouple tests

Signed-off-by: Vangelis Katikaridis <[email protected]>

* beatlabs#128 fix tests

Signed-off-by: Vangelis Katikaridis <[email protected]>

* beatlabs#193 fix tests

Signed-off-by: Vangelis Katikaridis <[email protected]>

* Update tracing and metrics dependencies (beatlabs#190)

Signed-off-by: Paschalis Tsilias <[email protected]>

* beatlabs#128 implement review comments

Signed-off-by: Vangelis Katikaridis <[email protected]>

* beatlabs#128 implement review comments

Signed-off-by: Vangelis Katikaridis <[email protected]>

* beatlabs#128 fix linting

Signed-off-by: Vangelis Katikaridis <[email protected]>

* beatlabs#128 update vendors

Signed-off-by: Vangelis Katikaridis <[email protected]>

* beatlabs#128 implement review comments

Signed-off-by: Vangelis Katikaridis <[email protected]>

* beatlabs#128 implement review comments

Signed-off-by: Vangelis Katikaridis <[email protected]>

* beatlabs#128 implement review comments

Signed-off-by: Vangelis Katikaridis <[email protected]>

* beatlabs#128 implement review comments

Signed-off-by: Vangelis Katikaridis <[email protected]>

* Upgraded github actions v2 (beatlabs#198)

Signed-off-by: Sotirios Mantziaris <[email protected]>

* beatlabs#128 make abstraction simpler and easier to use

Signed-off-by: Vangelis Katikaridis <[email protected]>

* beatlabs#128 add comment

Signed-off-by: Vangelis Katikaridis <[email protected]>

* beatlabs#128 fix linting

Signed-off-by: Vangelis Katikaridis <[email protected]>

* beatlabs#128 trigger the build

Signed-off-by: Vangelis Katikaridis <[email protected]>

* beatlabs#128 unexport response read writer

Signed-off-by: Vangelis Katikaridis <[email protected]>

* beatlabs#128 check for min < max

Signed-off-by: Vangelis Katikaridis <[email protected]>

* beatlabs#128 update vendor

Signed-off-by: Vangelis Katikaridis <[email protected]>

* beatlabs#128 remove timeinstant and make use of ttl cache only for route caching

Signed-off-by: Vangelis Katikaridis <[email protected]>

* beatlabs#128 update readme after latest changes

Signed-off-by: Vangelis Katikaridis <[email protected]>

* beatlabs#128 fix redis cache interaction and create cached route example

Signed-off-by: Vangelis Katikaridis <[email protected]>

* beatlabs#128 remove the processor specific logic for the cache

Signed-off-by: Vangelis Katikaridis <[email protected]>

* beatlabs#128 use the patron header alias instead of a raw map

Signed-off-by: Vangelis Katikaridis <[email protected]>

* beatlabs#128 fix linting

Signed-off-by: Vangelis Katikaridis <[email protected]>

* beatlabs#128 expose cache functionality as a middleware

Signed-off-by: Vangelis Katikaridis <[email protected]>

* beatlabs#128 fix linting

Signed-off-by: Vangelis Katikaridis <[email protected]>

* beatlabs#128 refactor cache logic to separate package

Signed-off-by: Vangelis Katikaridis <[email protected]>

* beatlabs#128 remove timeinstant abstraction

Signed-off-by: Vangelis Katikaridis <[email protected]>

* beatlabs#128 avoid defining the prometheus registerer

Signed-off-by: Vangelis Katikaridis <[email protected]>

* beatlabs#128 fix linting and exported objects

Signed-off-by: Vangelis Katikaridis <[email protected]>

* beatlabs#128 make middleware cache abstraction more concrete

Signed-off-by: Vangelis Katikaridis <[email protected]>

* beatlabs#128 make the naming conventions and structure more go like

Signed-off-by: Vangelis Katikaridis <[email protected]>

* beatlabs#128 fix imports

Signed-off-by: Vangelis Katikaridis <[email protected]>

* beatlabs#128 move timing request example to user service

Signed-off-by: Vangelis Katikaridis <[email protected]>

* beatlabs#128 fix typo

Signed-off-by: Vangelis Katikaridis <[email protected]>

* beatlabs#128 add package doc

Signed-off-by: Vangelis Katikaridis <[email protected]>

Co-authored-by: Stanislav Afanasev <[email protected]>
Co-authored-by: Giuseppe <[email protected]>
Co-authored-by: Alexander Demin <[email protected]>
Co-authored-by: Paschalis Tsilias <[email protected]>
Co-authored-by: Sotirios Mantziaris <[email protected]>
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.

Introduce HTTP server side caching
7 participants