编程决定java或.Net,db或no db

时间:2022-05-27 08:27:34

I am stuck while making a programming decision,

我在制定编程决策时遇到困难,

I am a .Net developer, I am currently building an application for my client that receives data from a third party application, it has to then perform operations on the values and send it to a webservice/servlet which then displays data to a webpage, The catch here is that the data being sent to the user(voting options, count etc) on the webpage must be updated every 2 seconds at the latest,

我是.Net开发人员,我正在为我的客户端构建一个从第三方应用程序接收数据的应用程序,然后它必须对值执行操作并将其发送到webservice / servlet,然后将数据显示到网页,这里的问题是,网页上发送给用户的数据(投票选项,计数等)必须最迟每2秒更新一次,

I have lots of confusion making some decisions,

我有很多困惑做出一些决定,

1) The data provider (third party app) recommends Java but doesnt enforce it, while I am good at .Net(C#), would you recommend building the app in C# or Java. in terms of optimisation and speed, which would be better? what do you guys recommend?

1)数据提供者(第三方应用程序)推荐Java但不执行它,而我擅长.Net(C#),你会建议用C#或Java构建应用程序。在优化和速度方面,哪个更好?你们推荐什么?

2) aftr receiving data from third party, me and my colleague are having mixed thoughts, I would prefer that as soon as data is received, we should write it to a db (since they are only a few fixed fields being sent each time), and then get the webservice/servlet to retrieve the data and then make calculations on it, my justification is that we would also have a track and historical data and user thought pattern if we save it, while m,y colleague says that saving it to db will delay the application considerably and that we should directly poll data from the app, he also reckons that the db will become massive in no time and slow, we tried doing this but it is causing a 8 second delay (for some reason tomcat is retrieving data only after every 7 attempts if its a webapp and saving it every second if it is a java console app., ) my thoughts are that if we save to db and retrieve from there, we can get the console app to write to app each second and then retrieve data using the webservice every second or so depending on what we want.

2)aftr从第三方接收数据时,我和我的同事有不同的想法,我希望一旦收到数据,我们应该把它写入数据库(因为它们每次只发送几个固定字段) ,然后获取webservice / servlet来检索数据,然后对其进行计算,我的理由是,如果我们保存它,我们也会有一个跟踪和历史数据以及用户思维模式,而m,y同事说保存它db会大大延迟应用程序并且我们应该直接从应用程序轮询数据,他还认为数据库将在任何时候变得庞大而且速度慢,我们尝试这样做但是它导致了8秒的延迟(由于某种原因tomcat如果它是一个webapp,它每隔7次尝试就检索一次数据,如果它是一个java控制台应用程序,则每秒保存一次。)我的想法是,如果我们保存到db并从那里检索,我们可以让控制台应用程序写入应用程序每秒,然后使用Web服务检索数据每隔一秒左右取决于我们想要什么。

In this scenerio, what do you guys reckon is a good approach, should we save to db or not save to db?

在这个场景中,你们认为什么是一个好方法,我们应该保存到db还是不保存到db?

3) Say even if we did save to db, would you reckon using berkeley or sqlserver make a difference? i would prefer using sqlserver for .net an berkeley for java

3)说即使我们确实保存到db,你会认为使用berkeley或sqlserver会有所作为吗?我更喜欢使用sqlserver for .net和berkeley for java

I know its a pretty big question and would be pretty boring but any help/suggestions will be much appreciated, please help us get more clarity with these issues stack overflow.

我知道它是一个非常大的问题,并且会非常无聊,但任何帮助/建议将不胜感激,请帮助我们更清晰地了解堆栈溢出这些问题。

Thanks for your time!

谢谢你的时间!

Regards.

3 个解决方案

#1


  1. You know C#, then use it. If no other constraints of technologies, use what you know best.

    你知道C#,然后使用它。如果没有其他技术限制,请使用您最了解的内容。

  2. Don't think of performance until you've tried both scenarios. Do a proof of concept, your way and your coleague's way, see the performance differences and whether the historical data advantace worths the performance difference.

    在尝试两种方案之前,不要考虑性能。做一个概念验证,你的方式和你的coleague的方式,看看性能差异和历史数据是否值得性能差异。

  3. Use SQL Server for C#. You may need to consider licensing into consideration (you know better the context of the project anyway).

    使用SQL Server for C#。您可能需要考虑许可(无论如何您更了解项目的上下文)。

#2


If you're comfortable with .NET, why would you spend time with Java? My concerns against Java are irrelevant, but in any case you'll be spending time learning Java, probably falling into the same pitfalls that any beginning developer falls into with any tool or technology.

如果您对.NET感到满意,为什么要花时间使用Java?我对Java的担忧是无关紧要的,但无论如何你都会花时间学习Java,可能会陷入任何初级开发人员使用任何工具或技术陷入的陷阱。

I say, if you're comfortable with .NET, do it in .NET. The end result won't be a lot different, but you'll get there faster.

我说,如果你对.NET感到满意,那就用.NET做吧。最终结果不会有太大的不同,但你会更快到达那里。

Then, making the calculations and using the database as a form of "cache" is different from keeping a track record. You can return the results from the third-party app and still store the history in a database. If it's too slow, queue it.

然后,进行计算并将数据库用作“缓存”的形式与保持跟踪记录不同。您可以从第三方应用程序返回结果,并仍将历史记录存储在数据库中。如果它太慢,请排队。

#3


  1. Use the language you know best as long as it is OK for your client.

    只要您的客户可以使用,您就可以使用您最熟悉的语言。

  2. Ask your client if the data has to be persisted, if it doesn't do no persist it. If you have to persist it you can do it asynchronously with no impact on the online processing.

    询问您的客户是否必须保留数据,如果不存在则不会持续存在。如果你必须坚持它,你可以异步进行,而不会影响在线处理。

  3. I don't know the differences, but the answer depends on what you want to do with the persistent data (how long do you want to keep it, do you need backups, are you willing to pay for a solution)... So if you know what you want to achieve you can choose the right tool, and maybe it won't be a database...

    我不知道差异,但答案取决于你想用持久数据做什么(你要保留多长时间,你需要备份,你愿意为解决方案买单)......所以如果你知道你想要实现什么,你可以选择合适的工具,也许它不会是一个数据库......

#1


  1. You know C#, then use it. If no other constraints of technologies, use what you know best.

    你知道C#,然后使用它。如果没有其他技术限制,请使用您最了解的内容。

  2. Don't think of performance until you've tried both scenarios. Do a proof of concept, your way and your coleague's way, see the performance differences and whether the historical data advantace worths the performance difference.

    在尝试两种方案之前,不要考虑性能。做一个概念验证,你的方式和你的coleague的方式,看看性能差异和历史数据是否值得性能差异。

  3. Use SQL Server for C#. You may need to consider licensing into consideration (you know better the context of the project anyway).

    使用SQL Server for C#。您可能需要考虑许可(无论如何您更了解项目的上下文)。

#2


If you're comfortable with .NET, why would you spend time with Java? My concerns against Java are irrelevant, but in any case you'll be spending time learning Java, probably falling into the same pitfalls that any beginning developer falls into with any tool or technology.

如果您对.NET感到满意,为什么要花时间使用Java?我对Java的担忧是无关紧要的,但无论如何你都会花时间学习Java,可能会陷入任何初级开发人员使用任何工具或技术陷入的陷阱。

I say, if you're comfortable with .NET, do it in .NET. The end result won't be a lot different, but you'll get there faster.

我说,如果你对.NET感到满意,那就用.NET做吧。最终结果不会有太大的不同,但你会更快到达那里。

Then, making the calculations and using the database as a form of "cache" is different from keeping a track record. You can return the results from the third-party app and still store the history in a database. If it's too slow, queue it.

然后,进行计算并将数据库用作“缓存”的形式与保持跟踪记录不同。您可以从第三方应用程序返回结果,并仍将历史记录存储在数据库中。如果它太慢,请排队。

#3


  1. Use the language you know best as long as it is OK for your client.

    只要您的客户可以使用,您就可以使用您最熟悉的语言。

  2. Ask your client if the data has to be persisted, if it doesn't do no persist it. If you have to persist it you can do it asynchronously with no impact on the online processing.

    询问您的客户是否必须保留数据,如果不存在则不会持续存在。如果你必须坚持它,你可以异步进行,而不会影响在线处理。

  3. I don't know the differences, but the answer depends on what you want to do with the persistent data (how long do you want to keep it, do you need backups, are you willing to pay for a solution)... So if you know what you want to achieve you can choose the right tool, and maybe it won't be a database...

    我不知道差异,但答案取决于你想用持久数据做什么(你要保留多长时间,你需要备份,你愿意为解决方案买单)......所以如果你知道你想要实现什么,你可以选择合适的工具,也许它不会是一个数据库......