Skip to content

perf: use bytes instead of text for config table #2829

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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

dracarys18
Copy link
Member

Type of Change

  • Enhancement

Description

Changed the data type of Config to Bytes instead of Text.

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

Motivation and Context

Bytes can be serialized and deserialized much faster than strings hence use Bytes than String for arbitrary data storage.

How did you test it?

  • Did Sanity testing of Payments,Refunds
  • Create a config
curl --location 'http://localhost:8080/configs/' \
--header 'Content-Type: application/json' \
--header 'api-key: test_admin' \
--data '{
    "key": "xdxdxdxdxd",
    "value": "2:lol"
}'
  • Fetch the config
curl --location 'http://localhost:8080/configs/xdxdxdxdxd' \
--header 'api-key: test_admin'
  • Update the config
curl --location 'http://localhost:8080/configs/xdxdxdxdxd' \
--header 'Content-Type: application/json' \
--header 'api-key: test_admin' \
--data '{
    "key": "xdxdxdxdxd",
    "value": "2:kek"
}'

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed the submitted code

@dracarys18 dracarys18 added A-core Area: Core flows S-waiting-on-review Status: This PR has been implemented and needs to be reviewed M-database-changes Metadata: This PR involves database schema changes labels Nov 10, 2023
@dracarys18 dracarys18 added this to the November 2023 Release milestone Nov 10, 2023
@dracarys18 dracarys18 self-assigned this Nov 10, 2023
@dracarys18 dracarys18 requested review from a team as code owners November 10, 2023 07:53
@dracarys18 dracarys18 marked this pull request as draft November 10, 2023 13:31
@likhinbopanna likhinbopanna modified the milestones: March 2024, April 2024 Apr 2, 2024
@bernard-eugine bernard-eugine modified the milestones: April 2024, May 2024 May 3, 2024
@SanchithHegde SanchithHegde removed this from the September 2024 Release milestone Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-core Area: Core flows M-database-changes Metadata: This PR involves database schema changes S-waiting-on-review Status: This PR has been implemented and needs to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants