If you like DNray Forum, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...

 

Deciding Between Java, C++, or Sticking with PHP

Started by Jennyholms, Aug 31, 2023, 06:36 AM

Previous topic - Next topic

JennyholmsTopic starter

Hello,

I need your guidance, my colleagues. Let me explain the purpose of the software and seek your expertise in recommending a compiled language.
To begin with, we will have a MySQL database consisting of about 30 tables. Alongside, there will be a web form that resembles the provided screenshot. By selecting certain parameters, this form will generate a new table by combining data from various database tables. Essentially, it is a website that utilizes analytics and logistics based on the database. Managers will input data into the database using the form and populate it with template Excel files. As time goes on, we will refine and expand the functionality and scale of the database. Additionally, in the future, we aim to develop applications for gadgets and synchronize them with the core database to display essential information.

Here's my proposed approach: we will use a Centos server running on Linux with MySQL and build the web application using PHP. At first glance, this seems sufficient. However, do you think we should consider a more robust framework on top of the database? Perhaps Java or C++, and then interface it with PHP? Our primary goal is to retrieve data from the database quickly and ensure its fault tolerance. While we currently have 20 active users, we anticipate growth in both functionality and software load over the coming years. Furthermore, we need to develop APIs to output specific information to gadget applications.

I kindly request your advice on the most suitable compiled language, along with the reasons behind your recommendation.
  •  


sigma-sem

Based on your requirements and goals, I would recommend considering Java as the compiled language for your web application. Here are the reasons behind this recommendation:

1. Performance: Java is known for its high performance, especially when it comes to handling large-scale applications and databases. It offers good memory management and efficient garbage collection, which can help with retrieving data quickly from the database.

2. Scalability: Java is designed to easily scale up as your application grows, making it suitable for handling increasing software load over the years. It provides robust support for concurrency and multithreading, allowing you to handle multiple users and requests simultaneously.

3. Fault tolerance: Java has built-in features like exception handling and error recovery mechanisms, making it reliable and fault-tolerant. It also offers various frameworks and libraries for implementing fault-tolerant architectures, ensuring the stability of your application.

4. Ecosystem and libraries: Java has a vast ecosystem and a wide range of libraries and frameworks available for building web applications. This can expedite your development process and provide you with additional functionality, such as APIs for gadget applications.

While PHP can be a viable option for web development, considering the long-term goals and scalability requirements mentioned, Java seems to be a more suitable choice. You can still interface Java with PHP if needed, using technologies like JavaServer Pages (JSP) or by building RESTful APIs to communicate between the different components of your application.

 additional points to consider:

1. Platform Independence: Java is known for its "write once, run anywhere" principle, meaning that Java code can be compiled into bytecode that can run on any platform with a Java Virtual Machine (JVM). This gives you the flexibility to deploy your application on different operating systems without major modifications.

2. Security: Java has a strong security model with features like sandboxing and strict access controls, making it suitable for applications that handle sensitive data. It also has built-in mechanisms for encryption, authentication, and secure communication.

3. Community and Support: Java has a large and active community of developers, which means you can find extensive dоcumentation, tutorials, and support forums. It also benefits from continuous updates and improvements from Oracle, the company behind Java.

4. Integration Options: Java offers various integration options for working with MySQL databases, such as JDBC (Java Database Connectivity), which is a standard API for connecting Java applications to relational databases. This allows you to easily interact with your MySQL database from your Java web application.

5. Future Expansion: If you plan to develop gadget applications and synchronize them with the core database, Java provides a strong foundation for this. You can leverage Java's robust APIs and frameworks for mobile and desktop development, such as Android for mobile apps or JavaFX for desktop applications.

Overall, Java provides the combination of performance, scalability, fault tolerance, security, and a vast ecosystem that aligns well with your requirements. It will give you the capability to handle current and future needs, integrate with your MySQL database efficiently, and expand your application to other platforms when required.
  •  

rpolarz

When creating an application with a web interface, the most straightforward approach is to utilize a language such as php/java/python/whatever. The resilience of the system does not rely on the specific choice of compiled language, but rather on the design of the system and the duplication of potential points of failure.

A well-designed web interface allows for seamless usage across desktop and mobile devices, eliminating the need for additional applications. This convenience enhances the overall user experience, making it easier to interact with the application regardless of the device being used.
  •  

goutammohanty

The description implies the existence of a large database and a user-friendly client for it. The primary requirements for the database include distribution, fault tolerance, and extensibility. Distribution and fault tolerance are easily achieved through clustering. However, ensuring extensibility relies heavily on the database's architecture - investing in proper architecture upfront prevents costly and challenging fixes down the line. Inadequate architecture leads to performance issues regardless of the cluster or optimized client code, ultimately resulting in project setbacks.

Thus, as you rightly mentioned, the language choice is not as crucial as the database. Numerous clients can be built in different languages, but maintaining business logic across multiple languages is expensive. If there is business logic, it is advisable to select a single language to write it in. Currently, Python and PHP are used for this purpose, and it is recommended to choose a language with which you are familiar, enabling easy scalability. An API is developed in this language to hide the business logic, resulting in straightforward and cost-effective client code that remains consistent across all clients.
  •  

kevinjlr62

I'd recommend sticking with PHP as the primary language for building the web application. Given the existing familiarity with the technology stack, it's a safe bet. PHP's ease of use, flexibility, and extensive libraries make it an ideal choice for web development.

Additionally, PHP can seamlessly integrate with MySQL, ensuring efficient data retrieval and manipulation. For the future, consider using a PHP framework like Laravel or CodeIgniter to enhance scalability and maintainability. For gadget applications, you can use RESTful APIs to output data in a standardized format.
  •  


If you like DNray forum, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...