Skip to content
This repository has been archived by the owner on Nov 2, 2022. It is now read-only.

add supabase read and write benchmarking #1

Merged
merged 4 commits into from
Sep 29, 2020

Conversation

inian
Copy link
Member

@inian inian commented Sep 28, 2020

What kind of change does this PR introduce?

Adds scripts to do read and write benchmarking of the end to end Supabase system. The results are then uploaded to your benchmarks table in your Supabase project.

@kiwicopple
Copy link
Member

Looking good Inian

I think Steve has been using the Chinook database for testing (see here, moving to supabase/benchmarks#9 ).

@steve-chavez - we are thinking of storing the results into a Supabase project so that we can track the changes over time. Inian has made a good starting schema, you may want to add feedback so that you can store the PostgREST benchmarks in there too?


-- BENCHMARKING-DATA
create table public.benchmarks (
id uuid not null primary key,
Copy link
Member

Choose a reason for hiding this comment

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

How about creating the uuid in postgres instead of js?

Suggested change
id uuid not null primary key,
id uuid default uuid_generate_v4 () not null primary key,

Then you could delete the function uuidv4() in the js files, I think.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the tip @steve-chavez. Moved uuid generation to pg in the recent commit.

"description": "scripts for benchmarking different aspects of the system",
"main": "read.js",
"scripts": {
"benchmark": "npm run cleanup && npm run benchmark-read; npm run benchmark-write; npm run write-results-to-db",
Copy link
Member

Choose a reason for hiding this comment

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

An mkdir output should be added here, otherwise the k6 summary export fails.

Copy link
Member Author

Choose a reason for hiding this comment

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

yes :) I just realised it when writing the github action.Added it in the latest commit.

@steve-chavez
Copy link
Member

I think Steve has been using the Chinook database for testing

Yes. the chinook tables are more realistic. This schema is a great start though, Chinook can be added on a later PR.

(Also if we agree on the schema, we could see the difference on KPS reads/writes and PostgREST reads/writes).

we are thinking of storing the results into a Supabase project so that we can track the changes over time.

This works great, much better than messing with json files. Thanks a lot Inian.
I'll be adding my results on a supabase db.

(Too bad k6 doesn't support sending the metrics on the script directly: grafana/k6#351)

@inian
Copy link
Member Author

inian commented Sep 29, 2020

@kiwicopple I think this PR can be merged. I will add the chinook db implementation in another PR.

@kiwicopple
Copy link
Member

Nice! 🎉

@kiwicopple kiwicopple merged commit 38fd9e5 into master Sep 29, 2020
@kiwicopple kiwicopple deleted the feat/add-read-write-benchmarking branch September 29, 2020 07:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants