Giter Site home page Giter Site logo

dynamodb_client_rs's Introduction

DynamoDB Client for Rust

Description

This Rust program provides a versatile interface to interact with AWS DynamoDB. It supports a variety of operations including scanning, counting, batch writing, and more, using the AWS SDK for DynamoDB. It's designed to demonstrate different ways to interact with DynamoDB, such as synchronous and asynchronous operations, various parallel processing methods, and performance measurement.

Prerequisites

  • Rust programming environment
  • AWS account and credentials configured
  • DynamoDB setup in the AWS environment
    • To add a table named books to DynamoDB with a partition key named id and a sort key named sort.

Installation

  1. Clone the repository.
  2. Navigate to the project directory.
  3. Ensure AWS credentials are set up.
    • Rename .env.sample to .env and configure your ID and KEY.

Usage

The program supports multiple operations with DynamoDB, which can be executed by passing arguments:

  • scan: Scan all items from the DynamoDB table books.
  • count: Count all items in the DynamoDB table books.
  • batch: Perform batch write operations to DynamoDB table books.
  • series_put: Put items into DynamoDB table books.
  • series_get: Get items from DynamoDB table books.
  • delete: Delete all items from the DynamoDB table books.
  • parallel processing methods:
    • channel: Perform batch write operations using channel parallel processing.
    • fork_join: Use fork-join parallel processing for batch writes.
    • map_reduce: Implement map-reduce pattern for batch writes.
    • pipeline: Apply pipeline processing for batch writes.
    • parallel_loop: Execute batch writes in a parallel loop.
    • worker: Use worker/master pattern for batch writes.
    • parallel_performance: Measure the performance of these parallel processes.

Run the program with the desired operation and optional item count (default is 100 for parallel processing) as arguments:

cargo run [operation]

For example:

cargo run delete
cargo run channel 500
cargo run parallel_performance 1000

Please note that you will be charged for data input and output operations performed on DynamoDB.

Performance

Data submission resulted in the following results. The average time (ms) for 10 trials of 1000 data submissions, respectively.

Processing Execution Time (ms)
Sequential processing 619
Channel parallel processing 71
Fork join parallel processing 38
Map reduce parallel processing 43ใ€€
Parallel loop processing 146
Worker/Master Pattern 46

Contributing

Contributions to the project are welcome. Please follow the standard fork, branch, and pull request workflow.

License

This project is licensed under the MIT License.

For more information on the MIT License, please visit https://opensource.org/licenses/MIT.

dynamodb_client_rs's People

Watchers

Yukiyoshi Chikugo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.