简体   繁体   English

什么是大规模系统的最佳方法-DB过程或编程逻辑

[英]What is the best approach for high scaled system - DB procedure or Programming logic

I am really caught into a puzzle. 我真的很困惑。

We use some language (java / php /python) as mediator between the frontend and db. 我们在前端和数据库之间使用某种语言(java / php / python)作为中介。 We use JPA / hibernate to smooth this data flow. 我们使用JPA / hibernate来平滑此数据流。 If we check with any DBA, most of the data processing, calculations, job processing can be done directly at db side with help of procedure or triggers that too with good scalability. 如果我们与任何DBA核对,大多数数据处理,计算,作业处理都可以借助过程直接在db端完成,也可以通过良好的可伸缩性触发。 Same thing if handled at java / php side it takes rather longer time and again issue might come up with scalability as transaction handling is not much straight forward. 如果在Java / PHP端处理同一件事,则需要花费更长的时间,而可伸缩性可能又会带来问题,因为事务处理不是很直接。

What I want to clear about my thought is : 1] is it really better / right approach to handle most possible logic with DB procedures ( like handling big chunk of processing impacting many tables ) ? 我要清除的想法是:1]使用DB过程处理大多数可能的逻辑真的更好/正确的方法(例如处理影响许多表的大块处理)吗? 2] Can scalability be acheivied with DB which can't be with Coding? 2] DB可以实现可扩展性吗,而Coding不能实现? 3] Is there any better way to look at this DB and Coding relation ? 3]有没有更好的方法来查看此数据库和编码关系?

Thanks in advance. 提前致谢。

Regards 问候

Well, based on what you said, you got them right, 好吧,根据您所说的,您说对了,

However, it is not always that you will have a correct answer, for example, I am working on a system with 6M+ records, you need to analyze the system and check the database performance, when you start, the performance will be good, but as the system scales and you started to have more and more records, here you will know if you can keep the triggers and everything in the database or you will need to hard code them, but from what I can see, you are good to have the calculations done in the database since it is shared between 3 systems. 但是,并非总是会有正确的答案,例如,我正在使用具有6M +记录的系统,需要分析系统并检查数据库性能,当您启动时,性能会很好,但是随着系统的扩展以及您开始拥有越来越多的记录,您将在这里知道是否可以将触发器和所有内容保留在数据库中,或者需要对它们进行硬编码,但是从我的角度来看,拥有由于数据库在3个系统之间共享,因此在数据库中完成了计算。

So my recommendations will be, keep the calculations in the Database unless you have to move them due to performance or any factor. 因此,我的建议是,将计算结果保留在数据库中,除非由于性能或任何因素而不得不移动它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 建立具有大量数据通信的系统的最佳方法是什么? - What is the best approach to build a system with high amount of data communication? 通过多个线程从数据库加载数据的最佳方法是什么 - What is the best approach for loading data from DB by multiple threads 调用以大XML文件作为参数的MSSQL过程的最佳方法是什么? - What is the best approach to invoke a MSSQL procedure, which takes a large XML file as an argument? 将变化的数据(多种格式)持久保存到公共数据库表中的最佳方法是什么? - What is the best approach to persist varying data (in multiple formats) into a common db table? 使用JasperReports的最佳方法是什么? - What is the best approach to use JasperReports? Java分类-最佳方法是什么 - Java classification - what is the best approach 学习java的最佳方法是什么 - what is the best approach to learning java 加密加密的最佳方法是什么? - What is best approach to encrypting an encryption? 初始化对象的最佳方法是什么 - What is the best approach for initialize object 哪种方法更适合POJO(字段格式化逻辑)? - What approach better for POJO (fields formatting logic)?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM