B
B
blabs2018-02-15 23:46:46
PostgreSQL
blabs, 2018-02-15 23:46:46

How to build work with BigData?

Below I described some of the tables from the database. Stack: PostgreSQL + Symfony4 + PHP7. We are considering the option of transferring operations to a separate database - ElasticSearch. But there is a difficulty with the relationship of tables. Below is a case.
Member table
- ID
- FIO
- Email
- Phone
- Password
- Date
Operation table
- ID
- Member_id -
Operation_type
- Value (true/false)
- Date
Operation_type table
- ID
- Name
- Date the Member table and an operation record (type Registration) in the operations table. Later, the admin displays the statistics of operations in the format:
- Member_ID
- Member_fio
- Member_Email -
Member_Phone
- Member_Date
- Operation_type_id
- Operation_value
- Operation_date
The operation data in the operations report contains the data of the user who performed the operation
. This raises the question of how to organize work with BigData, provided that there are links between tables?
We consider the following solution:
1. Make an entry in the operations table along with user data, which will be taken from the users table. In this case, if the user changes the data, it will be different in the reports
2. At the time of report generation, take part of the data from one database, part from another. At the same time, the operations must contain the identifier of this user.
Tell me, what solutions can be and what will be optimal for the described case?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Cheremisin, 2018-02-16
@leahch

Everything is quite simple, stop thinking in tables and start thinking in DOCUMENTS.
You have only two documents - two indexes. User Index, and Operations Index.
The user is a document with all the fields of the member table. And Operation, consists of the concatenation of member-operation-operationtype fields. Yes, the data in the Operations index will duplicate some fields from Users, but this is not scary, this is correct, since this is actually a log.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question