We needed a persistent storage for API keys and I came up with reading and writing json in plain text and the user thinks it works but is it very ineffecient compared to a relational dbms?
I just save the data as json and then edit it manually for this use case.
[
{
"241103000000056": {
"Value": "xxx-4c85-xxx-8420-xxx",
"account1": "3000",
"account2": "1910",
"series": "A"
},
"2411030000000516": {
"Value": "String",
"account1": "3000",
"account2": "1910",
"series": "A"
},
"2411030000000562": {
"Value": "Text",
"account1": "3000",
"account2": "1910",
"series": "A"
},
"2411030000000564": {
"Value": "100",
"account1": "3000",
"account2": "1910",
"series": "A"
},
"2411030000000566": {
"Value": "ZZZ",
"account1": "3000",
"account2": "1910",
"series": "A"
}
}
]
This has the advantage of rapidly getting a working use case when my user can manually add API keys instead of waiting for an admin ui for a database or a NoSQL storage. The variables are
Value
- an API key that the program uses per user
account1
- the debit account of the payment
account2
- the credit account of the payment
The data is only being read and written once every day in a batch process for payments and the data set is not very large (less than 100 and probably always will be less than 1000 because the API keys are merchants and businesses and not consumers).