Improving my database knowledge

Getting out of the comfort zone is always challenging for anyone. That's why it's so important as a kid to learn as much as you can. I see adults learning other languages when they have only one as a native. How challenging is it to make them try to get out of their comfort zone and learn another language? I faced similar problems when I joined a new job and he wanted to implement something that I had never seen: GraphQL.

I have been trained a lot during my postgraduate studies with regular SQL database management systems, the cute elephant from PostreSQL was my favourite and present in my Ph.D. However, the database structure of SQL can be challenging when you start dealing with multiple layers of tables. To query on them, you start to deal with multiple table joins.
We can use the example of Hive SQL, for example, if you want the top 10 accounts with the most comments, rewards and upvotes. We would need 4 tables (TxComments, VOCommentRewards ,VOCommentVotes and Account), In addition, only for this query, I would imagine a query with more than 10 lines of code. Because of that, usually the easiest systems to use data is the ones with less quantity of data hierarchy; the number of tables is easier to query. For complex data levels, there is another option: GraphQL. However, GraphQL is a totally different way of thinking; you aren't thinking on tables anymore, like the ones in Excel. You think of tables as nodes.
I posted about my accomplishments in 2022 . The theory is beautiful of the graphQL the query needed for that HiveSQL query would be reduced in half using a system using this type of graphs, but it was challenging to switch my logic gear in the brain, I took some time trying to design the perfect schemas for my database and understanding the logic of nodes representing data.The link between multiple tables is easier, but facing a different logic takes some time to get the click of understanding completely. I watched tutorials, and kept reading documents online, but finally got a schema ready with some data populated after some time.

For sure, I got a victory implementing something different that I was used to, as a person working with computer programming, we are usually challenged in learning a new language, with a new syntax. But this time I had to learn a whole new logic associated with the structure of data. I was proud about myself, but at the same time disappointed because the IT here couldn't host a GraphQL infrastructure, so we had to change all the systems back to the regular SQL. But nothing is more satisfying than facing a challenge, learning and finally executing what you learned. I am not using that anymore but I will definitely add that to my CV if I need to apply for a job that requires this knowledge.


Sair da zona de conforto é sempre um desafio para qualquer pessoa. Por isso, é tão importante, desde criança, aprender o máximo possível. Vejo adultos aprendendo outras línguas mesmo tendo apenas uma como língua materna. Quão desafiador é fazê-los tentar sair da zona de conforto e aprender outra língua? Enfrentei problemas semelhantes quando comecei em um novo emprego e ele queria implementar algo que eu nunca tinha visto: GraphQL.

Aprendi muito durante minha pós-graduação com sistemas de gerenciamento de banco de dados SQL comuns; o elefante fofo do PostreSQL foi meu favorito e esteve presente no meu doutorado. No entanto, a estrutura de banco de dados SQL pode ser desafiadora quando você começa a lidar com várias camadas de tabelas. Para consultá-las, você precisa lidar com várias junções de tabelas.
Podemos usar o exemplo do Hive SQL, por exemplo, se você quiser as 10 principais contas com mais comentários, recompensas e votos positivos. Precisaríamos de 4 tabelas (TxComments, VOCommentRewards, VOCommentVotes e Account). Além disso, apenas para esta consulta, eu imaginaria uma consulta com mais de 10 linhas de código. Por isso, geralmente os sistemas mais fáceis de usar dados são aqueles com menor quantidade de hierarquia de dados; o número de tabelas é mais fácil de consultar. Para níveis de dados complexos, há outra opção: GraphQL. No entanto, GraphQL é uma maneira totalmente diferente de pensar; você não pensa mais em tabelas, como as do Excel. Você pensa em tabelas como nós.
Publiquei sobre minhas realizações em 2022 . A teoria do graphQL é linda: a consulta necessária para aquela consulta HiveSQL seria reduzida pela metade usando um sistema que usa esse tipo de gráfico, mas foi desafiador mudar meu mecanismo lógico no cérebro. Levei algum tempo tentando projetar os esquemas perfeitos para meu banco de dados e entendendo a lógica dos nós que representam os dados. A conexão entre várias tabelas é mais fácil, mas encarar uma lógica diferente leva algum tempo para entender completamente. Assisti a tutoriais e continuei lendo documentos online, mas finalmente consegui um esquema pronto com alguns dados preenchidos depois de algum tempo.

Com certeza, obtive uma vitória implementando algo diferente do que eu estava acostumado. Como alguém que trabalha com programação de computadores, geralmente somos desafiados a aprender uma nova linguagem, com uma nova sintaxe. Mas desta vez, tive que aprender uma lógica totalmente nova associada à estrutura de dados. Fiquei orgulhoso de mim mesmo, mas ao mesmo tempo decepcionado, porque a TI aqui não conseguia hospedar uma infraestrutura GraphQL, então tivemos que mudar todos os sistemas de volta para o SQL padrão. Mas nada é mais gratificante do que enfrentar um desafio, aprender e finalmente executar o que você aprendeu. Não uso mais isso, mas com certeza adicionarei isso ao meu currículo se precisar me candidatar a uma vaga que exija esse conhecimento.

Obrigado por promover a comunidade Hive-BR em suas postagens.
Vamos seguir fortalecendo a Hive
Honestly, when i saw your second image, i knew that i will meet new things from your post today, and i really did. Its nice to see that you got some accomplishments.
The more we learn the more we know that we dont’t know anything 🤣! But yeah we ve got some experience in some areas in our bag!
Meus parabéns @gwajnberg! Eu tenho um pouco de noção de programação, mas programar não é muito minha praia. Piorou ainda banco de dados admiro muito que tem dominio sobre esses conhecimentos
Questão é tentar! Mas eu tive curso de banco de dados e sofri na pós kkkk! Professores exigentes!
At work we use postgresql, oracle and sqlserver...i like postgresql the most but for queries you need to use an ORM (Object-Relational Mapping), we use hibernate
That makes queries easy
Yeah I need to take a look on that! someone mentioned on me already! that's nice =)
The knowledge of database is quite troublesome as far as I know. l read some basics about it in my XI-XII classes and I can remember it was difficult for me to learn about it.
You just need practice for sure! if we only learn the theory is difficult!
Caramba mano, nunca ouvi falar de GraphQL kkkkk, agora deu até vontade de estudar sobre isso, ver como que é e como seria implementar! Parece ser bem interessante! Não tem coisa melhor do que a sensação de um desafio vencido!
voce tem que fazer o design todo baseado nisso
Vou dar uma estudada! Valeu mano!
That is pretty cool, far more than I know how to do. I didn't know the Hive SQL was that complicated, I guess if you don't ever ask you neve find out!
!PIMP