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

Redesign s3s-fs #163

Open
Nugine opened this issue Aug 11, 2024 · 5 comments
Open

Redesign s3s-fs #163

Nugine opened this issue Aug 11, 2024 · 5 comments
Labels
feature New feature or request

Comments

@Nugine
Copy link
Owner

Nugine commented Aug 11, 2024

Currently s3s-fs is just an example for how to implement a storage service with s3s.

Current Problems

  • logical concurrent safety is not guaranteed
  • internal metadata implementation is too naive
  • difficult to support more operations than the basic ones

Goals

  • a better architecture, correctness first, more extensible
  • still an example, easy to understand, hide details behind abstractions

Non-goals

  • extremely high performance
  • production ready
@Nugine Nugine added the feature New feature or request label Aug 12, 2024
@Nugine Nugine pinned this issue Sep 2, 2024
@Nugine
Copy link
Owner Author

Nugine commented Nov 8, 2024

meta store: sqlite

blob store: filesystem

object-level rwlock

@balchua
Copy link

balchua commented Dec 13, 2024

I'd like to learn more about s3s-fs, i know its not meant for production.
However i'd like to see how to add Http body limit, is this something that can be implemented in the s3s-fs? A good pointer will be great.
I am also new to rust and hyper. 😀. So there's definitely skill issue here.

Btw thanks for the project!!

@Nugine
Copy link
Owner Author

Nugine commented Dec 13, 2024

However i'd like to see how to add Http body limit, is this something that can be implemented in the s3s-fs? A good pointer will be great.

Http body limit can be implemented as a middleware like axum::extract::DefaultBodyLimit.
s3s is based on hyper so you can easily combine it with hyper ecosystem and tower ecosystem.

To add http body limit to s3s-fs:

  1. Add a cli arg for configuring max body limit
  2. Wrap the S3Service with a body limit middleware
  3. Test whether it works

Or, another way is that we implement stream-aware body limit in s3s.
I'm not sure about the best design right now. It may be related with #155.

Good luck!

@balchua
Copy link

balchua commented Dec 14, 2024

Thanks @Nugine , i tried implementing a simple one, but struggling to return a hyper Response, when returning a 413 error.

I was trying to add a layer using the ServiceBuilder. I think im doing something wrong. Was wondering if you happen to have a sample on how to add a middleware that returns an Error.

Thanks again for your help.

Im also interested on implementing the the metadata store as you mentioned above.

@Nugine
Copy link
Owner Author

Nugine commented Dec 14, 2024

how to add a middleware that returns an Error

The middleware works on Request/Response. You can just convert the error to a Response by setting the status code (413) and corresponding body. S3Error can be also converted to a Response.

Related

Im also interested on implementing the the metadata store as you mentioned above.

Thanks! I have no clear design for now. You can try to implement ideas in your fork and show it here.
We may accept a well-designed architecture from contributors. See also #174

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants