aboutsummaryrefslogtreecommitdiff
path: root/readme.md
diff options
context:
space:
mode:
authorpacien2021-07-24 13:05:05 +0200
committerpacien2021-07-24 13:05:05 +0200
commit5fa8d869f476323d5243111b6c6c785c83d99400 (patch)
tree5d210d4e12d5cd5b91d78317db4e58d2ff8031be /readme.md
parent14f70e92e249f56ecf413fa8f262cb6120ea3350 (diff)
downloaduge_l2_rdbms_python_proto-5fa8d869f476323d5243111b6c6c785c83d99400.tar.gz
sql: create database schema
Diffstat (limited to 'readme.md')
-rw-r--r--readme.md49
1 files changed, 49 insertions, 0 deletions
diff --git a/readme.md b/readme.md
index b75e14a..3c53966 100644
--- a/readme.md
+++ b/readme.md
@@ -14,6 +14,55 @@ the former from preceding units.
14To showcase Python as a platform suitable for this purpose, a small demo 14To showcase Python as a platform suitable for this purpose, a small demo
15project specified in `./demo-project-specs.md` will be implemented. 15project specified in `./demo-project-specs.md` will be implemented.
16 16
17The present document aims to motivate the functional and technical choices
18which have been made.
19
20
21## Interpretation of the specifications
22
23Undefined aspects of the specifications are clarified as follows, with the
24intent of keeping the project as simple as possible:
25
26* the platform only deals with one currency ([simoleons], arbitrarily),
27* the platform only supports one language (English, arbitrarily),
28* each user only has one account/wallet/balance (all three terms synonymous),
29* there is no notion of financial order (transactions are immediate),
30* only the effective transactions are logged, the rejected ones are not,
31* fees are billed on top of internal transfers instead of taking a cut.
32
33[simoleons]: https://en.wiktionary.org/wiki/simoleon
34
35
36## Database model
37
38### Entity-relationship model
39
40The database model is fully described as types, tables and constraints in
41`./sql/tables.sql`. The file is annotated with comments and remarks explaining
42the design choices and highlights some additional constraints which remain to
43be enforced at upper levels.
44
45An entity-relationship diagram of the model can be generated from the SQL table
46descriptions using a tool like [SQLFairy] (_note: SQLFairy [crashes] with
47recent PostgreSQL dialects, so it is not usable here_).
48
49[SQLFairy]: http://sqlfairy.sourceforge.net/
50[crashes]: https://rt.cpan.org/Public/Bug/Display.html?id=138045
51
52### Consistency
53
54The consistency of the account balance and the financial transaction log can
55be ensured through multiple means such as executing modification and insertions
56in SQL transactions at the application level, or using triggers within the
57database itself. The former option is chosen over the latter to avoid implicit
58actions.
59
60Additional constraints to prevent alterations of the financial transaction log
61such as deletions are omitted here as the web application will act as the sole
62gateway to interact with the database and will offer no way of doing this kind
63of operations. For the same reason, the use of stored procedures was not
64retained.
65
17 66
18## Copyright and licensing 67## Copyright and licensing
19 68