PCDE Module 14 Content: Java & Debezium

Discussion 14.1: Compare and Contrast Java and Python

Prompt

As you continue to learn the differences between Java and Python programming, it is important to consider the use cases for each. Java has statically set variable types and a faster runtime because it is a compiled language. However, Python can usually be written with fewer lines of code and is an interpreted language, so there is no need to compile. Regardless of their differences, both are among the most commonly used programming languages in the industry.

In this discussion, you will select two projects from the list below and give three reasons why each project should be written in Python, Java, or some combination of the two. Consider factors such as scalability, modularity, speed, and configurability when deciding which technology to use.

Project Scenarios

  1. Product Pre-Order Website: Your organization has just released a new product, and they need to take pre-orders. This web interface will have to communicate to a back-end project, relay data to and from a database, accept credit card payments, and it is expected to have high traffic at the time of the product’s release.
  2. Weather Predictor: You’re working on a pre-existing website that displays the weather for the next 10 days. You get data from a centralized API, and you wish to further enhance the API’s predictions. The website is already designed, your team has tasked you with analyzing incoming data and communicating new predictions with the web interface.
  3. Data Collection and Management: Your team collects specific data from a competitor’s website and places it in a .csv file. Your task is to write a program that reads the file, does any necessary processing, and then places the data in a database. Your program will be run on an automated schedule and will have no interface.
  4. Online Chess: The task is to make an online chess game where players can compete against their friends. You also want to add chess bots with differing levels of difficulty. The game is also expected to be the best of its kind and very popular, so scalability is crucial.
  5. Tracking COVID-19 Trends: Your organization has tasked you with writing a program that will look at employee infection data and attempt to predict when the next case spike will occur. This will help manufacturing prepare for the loss in the workforce. The tool will be used by management and will use a very large data set since the organization has over 100,000 employees.

Read the statements posted by your peers. Engage with them by responding with thoughtful comments and questions to deepen the discussion.

Suggested Time: 60 minutes

Suggested Length: 300 words

This is a required activity and will count toward course completion.

My Response

Project 1: Product Pre-Order Website

For a website that is going to receive a lot of traffic, the gut reaction might be to use the faster language ecosystem of Java. However, because this is only a pre-order website, that will not have high-traffic for long, my guess is that it might actually be cheaper to implement using Python. The reason for this is that developers are more expensive. Because the period of high traffic is probably going to be short, you may only need to over-provision servers to accept the traffic for a short time. That means it might actually be more expensive to pay for the extra development time to implement the website in Java. In Python, you just run more servers behind a load balancer and as the traffic reduces after the initial rush of pre-orders, you start to reduce the number of active servers and save some development costs. Very likely, the database system might be the bottleneck, in this case.

Project 4: Online Chess

Since the backend for this project is likely going to be relatively simple, but require of long-term scalability, I'm choosing Java. The extra development time to implement the backend in Java is probably going to be worth it. There isn't much extra complexity to this service, other than the chess-playing bots which can add a lot of CPU and memory usage. For that reason it seems worth it to make the backend faster and use less memory at the cost of more development time.

Knowledge Check 14.1: Data Types, Classes, Objects, and Packages in Java

Knowledge Check 14.2: Java Applications

Knowledge Check 14.3: Debezium

References

Web Links

Note Links