D
D
Danila2015-06-22 23:58:59
Database
Danila, 2015-06-22 23:58:59

General database questions?

Guys I will write the first highload superservice for myself that will conquer the world under the number five hundred. There are a couple of general questions on architecture. Backend Silex, Postgres, Redis, Varnish. Almost all words will be used for the first time and mastered along the way.
By database:
1. Data security is not critical, but is there any point in making different database accounts for different user statuses (admin, not admin), while there will be filtering / protection at the level of middleware routes?
2. The goal in terms of the base structure is to make it as unnecessary as possible in joins, due to the lack of extensive design experience, I will most likely achieve this only after N iterations, but is there any methodology to simplify the process, except to try to understand the entire application and all his possible requests at once and all this immediately outlined in the diagrams?
3. Do I understand correctly that the achievement of the 5th normal form, in addition to being practically impossible, is also not about performance?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stanislav Makarov, 2015-06-23
@Nipheris

> The purpose of the base structure is to make it as unnecessary as possible in joins.
Why is such a goal set? Maybe you need to reconsider the technical issues? The absence of the need for joins leads to the appearance of redundancy, just the same, they usually try to achieve the opposite - a minimum of redundancy through the use of joins. Highload certainly has specific requirements, which is why I'm wondering why such a condition was set.
> achieving 5th normal form besides being nearly impossible
I would argue about the impossibility. Rather - it is rarely appropriate, 3NF is usually sufficient. But there are exceptions (temporal data for example). As for performance, I also disagree - performance is much more formed by correctly / crookedly constructed indexes and correct / crooked queries. Better 15 joins in a query using indexes than a single LIKE '%str%' without full-text indexing. Modern DBMSs are able to cache indexes in memory, and prepared statements allow you not to parse the same query a million times.
In general, understand one rule: there is always a design first on paper, and then in real life. You must normalize first of all for yourself in order to understand what dependencies you have in the data. When you see all this, you can always denormalize. Your N iterations are M+K where M is the normalization iterations, K is the reverse process where you deliberately lower the normal form of your data. If you ignore functional dependencies, your data will quickly turn into a personal hell.
And finally, if you ask such a question - are you sure that you will pull the highload in principle?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question