我想知道在 QLDB 中设计表的最佳方式,以及是否最好执行连接或嵌套文档。例如,如果我有表格transaction
并且payment
付款必须与交易相关联。以下哪个选项是最好的;
嵌套文档选项(一个表)
{
'payment_reference': 'abc123',
'transaction': {
'id': 123,
'name': 'John Doe',
'amount': '$10'
},
'fees': '$2',
'amount_paid': '$12'
}
两个表选项
付款文件
{
'payment_reference': 'abc123',
'transaction_id': 12,
'fees': '$2',
'amount_paid': '$12'
}
交易文件
{
'id': 123,
'amount': '$10',
'name': 'John Doe',
}