Online Judge from Scratch(2) – Dispatcher

The dispatcher, as the name implies, fetches judge tasks from RabbitMQ, dispatches them to the sandbox workers and gets the results back synchronously. In Justice, the sandboxes are language-specific: If the submission is written in Java, we can sandbox it with Java Security Manager. If the submission is written in C/CPP, we need another sandbox … Continue reading "Online Judge from Scratch(2) – Dispatcher"

Read More

「Designing Data-Intensive Applications」Chapter 3

Storage and Retrieval Data Structures That Power Your Database An index is an additional structure that is derived from the primary data. An important trade-off in storage systems: well-chosen indexes speed up read queries, but every index slows down writes. Hash Indexes Keep an in-memory hash map where every key is mapped to a byte … Continue reading "「Designing Data-Intensive Applications」Chapter 3"

Read More

「Designing Data-Intensive Applications」Chapter 2

Data Models and Query Languages The limits of my language mean the limits of my world.                  — Ludwig Wittgenstein, Tractatus Logico-Philosophicus (1922) Data models are perhaps the most important part of developing software, because they have such a profound effect: not only on how the software is … Continue reading "「Designing Data-Intensive Applications」Chapter 2"

Read More

「Designing Data-Intensive Applications」Chapter 1

Reliable, Scalable, and Maintainable Applications   A data-intensive application is typically built from standard building blocks that provide commonly needed functionality. For example: Store data so that they, or another application, can find it again later (databases) Remember the result of an expensive operation, to speed up reads (caches) Allow users to search data by keyword … Continue reading "「Designing Data-Intensive Applications」Chapter 1"

Read More

Online Judge from Scratch(1) – Frontend

The frontend of Justice contains two sites: the web UI for users and the admin panel for administrators, the main reason to choose Yii2 is the Advanced Application Template provides both succinct project structure and great convenience to share the same logic between the two sites: Besides, we improved Yii2’s MVC pattern by adding an … Continue reading "Online Judge from Scratch(1) – Frontend"

Read More

Online Judge from Scratch(0) – Architecture

An online judge system(like codeforces, leetcode, etc) contains a problem set of algorithms to solve, while users can compile a piece of code and execute the generated binary with pre-constructed data to test if the code is correct. However details of algorithms won’t be discussed here, we mainly focus on how to build an online judge … Continue reading "Online Judge from Scratch(0) – Architecture"

Read More