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

How to add support for a few more services like AWS DynamoDB and Google Cloud Spanner? #220

Open
quettabit opened this issue Jun 19, 2024 · 2 comments

Comments

@quettabit
Copy link

hey @wangrunji0408!

thank you for putting out this great library. we are currently evaluating between turmoil and madsim. i'm seeing a good amount of work (different ones though given our current state) required on our end either ways, so would like to pick your brain that will be very helpful.

to begin with, i'm only concerned with DynamoDB.

i took a quick look on previous similar discussions/attempts like #107 and #122 (comment) and have got some intuitions re: how to go re: DynamoDB support.

i'd like to hear your recommendations specifically for DynamoDB, in case i'm missing things.

@quettabit quettabit changed the title Any recommendations on how to add support for a few more services like AWS DynamoDB and Google Cloud Spanner? How to add support for a few more services like AWS DynamoDB and Google Cloud Spanner? Jun 20, 2024
@wangrunji0408
Copy link
Member

Hi. Thank you for your interest. In short, to simulate an external system in madsim, you need to create a madsim-based mock for the third-party library. This includes a single-threaded server-side mock and a client-side mock that communicates with it using madsim internal APIs.

For DynamoDB, I need to know which library you use to interact with DynamoDB in your project. If you're using aws-sdk-dynamodb, it has a similar structure to aws-sdk-s3, so madsim-aws-sdk-s3 could be a useful reference.

To implement this simulator, start with a blank project and patch it into your project as aws-sdk-dynamodb. Then, try to fix compilation errors, leaving many todo!(). This will give you a subset of APIs that you need to implement. Next, you just need to mock these APIs. We might provide a developer guide with technical details in the future.

Regarding the comparison with turmoil, as far as I know, turmoil simulates the network at a lower TCP layer, while madsim works at a higher level. madsim can transfer in-memory data structures directly from client to server without serialization. This makes simulations more efficient but requires more code to implement the simulator.

Please let me know if there’s anything we need to do. I would be happy to help.

@quettabit
Copy link
Author

awesome. thank you so much for the deets and the pointers.

yeah, we are indeed using aws-sdk-dynamodb. cool, i'll try to play with it based on your suggestions.

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

No branches or pull requests

2 participants