An OOP version with CPP of the transaction srever, for benchmarking and self-learning purposes
- Update all git submodules first using
git submodule update --recursive --remote
- Run
cmake -S . -B build
in the root directory to create build folder and generate Makefile. - Run
cmake --build build
in the root directory to generate theapp
binary. - Run
./build/app
- Create Transaction with list of items
- Check if user exists in transaction
- Add/remove user to transaction
- Update user's item map
- Check if item is unused (validate amount and price)
- Check if user has item (validate amount and price)
- Update unused item map
- Get copy of entire transaction as a
transaction_map
, unused items inunused
key - Print out transaction for easy visual debugging
- Added CMake for easier compilation
addUser
- Add usersremoveUser
- Add then remove users + check if items are returnedisUserInTransaction
- add users, check valid user, check invalid user.updateItemPrice
- check updating non-existent item, valid price, invalid price, check all user's priceupdateUserItem
- add users, check adding/remove non existent items. check adding/remove valid amount of items. check adding/removing invalid number of items
updateTransaction (ADD_USER)
- Add users to a specific transaction by tId, needs to be existing tId and non existing userIdupdateTransaction (CHECK_USER)
- Check if a user exists in a transaction or not, should return correct boolupdateTransaction (REMOVE_USER)
- Remove users from a specific transaction by tId, needs to be existing tId, and existing userIdupdateTransaction (UPDATE_USER_ITEMS)
- Add/remove valid/invalid items from valid/invald users, check transaction map conserved in all casesupdateTranasaction (UPDATE_ITEM_PRICE)
- Update an item's price and unused + all users for that tId should correlate
- Add Google Test to CMake
- Add single threaded tests
- Add all tests and their description to README
- Test out adding multiple items to multiple users concurrently
- Add read/write locks per item/user in transaction (only added a reader writer lock for the item map)
- Add a Transaction Manager to hold a group of transactions and perform actions on them
- Add test for all TransactionManager methods to ensure edge cases are covered
- Test out adding multiple items to multiple users concurrently
- Add read/write locks per item/user in transaction - Currently exists locks for
item_map
- Replace tuples with items/user objects
- Replace all current
strings
withstring_views
- DONE - Transaction manager to add a wrapper to update multiple transactions - DONE but requires constructor to initialize, and a structure messages
- Add Factory class for creating transactions (possible empty transaction, user id, transaction id, think about merging in the future but less important)
- User permissions, user can only update their own items
- Item UUIDs
- Transaction UUIDs
- Deal with making/parsing small JSON objects & making message formats for actions
- Add Boost Beast and Booost ASIO as dependencies to CMake for future websockets
- Think of big pictue product flow of a transacton (may require transaction states like
finishTransaction
etc.) - Create high level framework on top of Boost Beast to run a Websocket Server, create server message formats
- JWT / Authentication / Authorization for Users
- Need to use acquire-release semantic to decrease lock usage as much as possible - starting with a shared mutex to allow concurrent reads and writes, but eventually need to move to TBB
concurrent_hash_map
- Prefer task bansed over threasd based concurrency
- I'm basically building a cache, soon need to start thinking about the architecture and how to fit it in, otherwise I'm basically rebuilding redis