Skip to content

rfcardoso07/microservices-auth-benchmark

Repository files navigation

Microservices Auth Benchmark

Application Architecture

Architecture

Auth Mechanism

Auth

Service Endpoints

Customer Service

/createCustomer

Request Body

{
    "customerName": "Alice",
    "customerEmail": "[email protected]"
}

Response Body

{
    "message": "success",
    "customerID": 1,
    "accountID": 1
}

/deleteCustomer

Request Body

{
    "customerID": 1
}

Response Body

{
    "message": "success",
    "customerID": 1,
    "accountIDs": [1, 2, 3]
}

/getCustomer

Request Body

{
    "customerID": 1
}

Response Body

{
    "message": "success",
    "customerID": 1,
    "customerName": "Alice",
    "customerEmail": "[email protected]"
}

Account Service

/createAccount

Request Body

{
    "customerID": 1
}

Response Body

{
    "message": "success",
    "accountID": 1
}

/deleteAccount

Request Body

{
    "accountID": 1
}

Response Body

{
    "message": "success",
    "accountID": 1
}

/deleteAccountsByCustomer

Request Body

{
    "customerID": 1
}

Response Body

{
    "message": "success",
    "customerID": 1,
    "accountIDs": [1, 2, 3]
}

/getAccount

Request Body

{
    "accountID": 1
}

Response Body

{
    "message": "success",
    "accountID": 1,
    "customerID": 1,
    "balance": 100
}

/getAccountsByCustomer

Request Body

{
    "customerID": 1
}

Response Body

{
    "message": "success",
    "customerID": 1,
    "accountIDs": [1, 2, 3],
    "balances": [100, 50, 10]
}

/addToBalance

Request Body

{
    "accountID": 1,
    "amount": 50
}

Response Body

{
    "message": "success",
    "accountID": 1,
    "amountAdded": 50
}

/subtractFromBalance

Request Body

{
    "accountID": 1,
    "amount": 50
}

Response Body

{
    "message": "success",
    "accountID": 1,
    "amountSubtracted": 50
}

Transaction Service

/transferAmount

Request Body

{
    "senderID": 1,
    "receiverID": 2,
    "amount": 50
}

Response Body

{
    "message": "success",
    "transactionID": 1,
    "senderID": 1,
    "receiverID": 2
}

/transferAmountAndNotify

Request Body

{
    "senderID": 1,
    "receiverID": 2,
    "amount": 50
}

Response Body

{
    "message": "success",
    "transactionID": 1,
    "senderID": 1,
    "receiverID": 2,
    "notificationID": 1
}

/getTransaction

Request Body

{
    "transactionID": 1
}

Response Body

{
    "message": "success",
    "transactionID": 1,
    "senderID": 1,
    "receiverID": 2,
    "amount": 50
}

Notification Service

/notify

Request Body

{
    "transactionID": 1,
    "receiverID": 2,
    "amount": 50
}

Response Body

{
    "message": "success",
    "notificationID": 1,
    "recipientEmail": "[email protected]"
}

/getNotification

Request Body

{
    "notificationID": 1
}

Response Body

{
    "message": "success",
    "notificationID": 1,
    "transactionID": 1,
    "receiverID": 2,
    "amount": 50
}

Balance Service

/getBalanceByCustomer

Request Body

{
    "customerID": 1
}

Response Body

{
    "message": "success",
    "customerID": 1,
    "accountIDs": [1, 2, 3],
    "balances": [100, 50, 10],
    "totalBalance": 160
}

/getBalanceHistory

Request Body

{
    "customerID": 1,
    "numberOfRecords": 5
}

Response Body

{
    "message": "success",
    "customerID": 1,
    "totalBalance": [30, 50, 80, 120, 160],
    "recordTimestamps": ["2024-01-15 12:00:00", "2024-01-15 15:30:00", "2024-01-16 08:45:00", "2024-01-17 10:00:00", "2024-01-18 18:20:00"]
}

Inter-Service Communication

Account Service

  • Account Service → Create Account

  • Account Service → Delete Account

  • Account Service → Delete Accounts By Customer

  • Account Service → Add To Balance

  • Account Service → Subtract From Balance

  • Account Service → Get Account

  • Account Service → Get Accounts By Customer

Customer Service

  • Customer Service → Create Customer

    • Account Service → Create Account
  • Customer Service → Delete Customer

    • Account Service → Delete Accounts By Customer
  • Customer Service → Get Customer

Balance Service

  • Balance Service → Get Balance By Customer

    • Account Service → Get Accounts By Customer
  • Balance Service → Get Balance History

Notification Service

  • Notification Service → Notify

    • Account Service → Get Account
    • Customer Service → Get Customer
  • Notification Service → Get Notification

Transaction Service

  • Transaction Service → Transfer Amount

    • Account Service → Add To Balance
    • Account Service → Subtract From Balance
  • Transaction Service → Transfer Amount And Notify

    • Account Service → Add To Balance
    • Account Service → Subtract From Balance
    • Notification Service → Notify
      • Account Service → Get Account
      • Customer Service → Get Customer
  • Transaction Service → Get Transaction

Operation Types

  • Create CustomerWRITE

  • Delete CustomerDELETE

  • Get CustomerREAD

  • Create AccountWRITE

  • Delete AccountDELETE

  • Delete Accounts By CustomerDELETE

  • Get AccountREAD

  • Get Accounts By CustomerREAD

  • Add To BalanceWRITE

  • Subtract From BalanceWRITE

  • Transfer AmountWRITE

  • Transfer Amount And NotifyWRITE

  • Get TransactionREAD

  • NotifyWRITE

  • Get NotificationREAD

  • Get Balance By CustomerREAD

  • Get Balance HistoryREAD

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published