Closed esokullu closed 7 years ago
why a new subfolder?
It's need because all similar classes should be in one folder.
why PhoORM for just one function (createTableIfNeed, we don’t need that)
save()
If we don't want create unique id each time when we want to create new instance we need this method.createTableIfNeed()
(I agree what name is wrong). Now we have just two models User and Note.
When we will have at least ten models It will be difficult to create new tables for each model.
In DynamoDB creating new tables not so easy.
Look, this data needs to create table just for User:
{
"TableName": "user",
"KeySchema": [
{
"AttributeName": "user_id",
"KeyType": "HASH"
}
],
"AttributeDefinitions": [
{
"AttributeName": "user_id",
"AttributeType": "S"
},
{
"AttributeName": "user_name",
"AttributeType": "S"
},
{
"AttributeName": "user_email",
"AttributeType": "S"
},
{
"AttributeName": "user_provider_type",
"AttributeType": "S"
}
],
"ProvisionedThroughput": {
"ReadCapacityUnits": 1,
"WriteCapacityUnits": 1
},
"GlobalSecondaryIndexes": [
{
"IndexName": "index_user",
"KeySchema": [
{
"AttributeName": "user_id",
"KeyType": "HASH"
}
],
"Projection": {
"ProjectionType": "ALL"
},
"ProvisionedThroughput": {
"ReadCapacityUnits": 1,
"WriteCapacityUnits": 1
}
},
{
"IndexName": "idx_user_name",
"KeySchema": [
{
"AttributeName": "user_name",
"KeyType": "HASH"
}
],
"Projection": {
"ProjectionType": "KEYS_ONLY"
},
"ProvisionedThroughput": {
"ReadCapacityUnits": 1,
"WriteCapacityUnits": 1
}
},
{
"IndexName": "idx_user_email",
"KeySchema": [
{
"AttributeName": "user_email",
"KeyType": "HASH"
}
],
"Projection": {
"ProjectionType": "KEYS_ONLY"
},
"ProvisionedThroughput": {
"ReadCapacityUnits": 1,
"WriteCapacityUnits": 1
}
},
{
"IndexName": "idx_user_provider_type",
"KeySchema": [
{
"AttributeName": "user_provider_type",
"KeyType": "HASH"
}
],
"Projection": {
"ProjectionType": "KEYS_ONLY"
},
"ProvisionedThroughput": {
"ReadCapacityUnits": 1,
"WriteCapacityUnits": 1
}
}
]
}
I think to do this manually each time when we need to create new model is very complicated.
naming doesn’t conform standards, ifNeeded
fixed.
Same with DynamoDB/User.php — there rest end with ..Model.php why this not?
fixed
Don't like the structure: src/app/model/DynamoDB
Same with DynamoDB/User.php — there rest end with ..Model.php why this not?
Standards important