Examen-Computo-en-la-Nube: NovaCore: The Cloud Exam Project That Ships a Real Store
Inside AvanTI Shop, an all-or-nothing checkout is not application logic. It is one database transaction, and everything interesting about this codebase lives on either side of that boundary.
- A repository named for a cloud computing exam quietly ships a working three-tier storefront, admin panel, and AWS deployment.
- The entire checkout guarantee lives in one @Transactional annotation: the database, not the application, enforces all-or-nothing.
- A single property flips image storage between local disk and S3 while the rest of the application stays unaware.
- The same reliance on the database that makes checkout correct is absent from the concurrent stock check, which can oversell.
The Name Says Exam. The Code Says Store.
A repository named Examen de Cómputo en la Nube should contain a quiz. It contains a store.
Open the repo and you find a Spanish-language e-commerce application for computer components, branded AvanTI Shop, packaged under the Java namespace NovaCore. There is a customer storefront with a category catalog, product search, detail pages, a cart, and a purchase confirmation screen. There is an admin panel for creating, editing, searching, and deleting products, plus recording inventory entries and exits. Underneath sit a MySQL schema with five tables, a Spring Boot entry point, and a deployment story that runs across EC2, RDS, and S3. The name is the only small thing about the project.
The README states the business rule plainly: every purchase is saved as an order and decrements stock immediately, and if any item lacks stock the whole purchase is cancelled and nothing is saved. That rule is the spine of the application. It is also, as we will see, implemented in a surprising place.
| Layer | Technology |
|---|---|
| Language | Java 21 |
| Framework | Spring Boot 3.5.6 |
| Views | JSF (JoinFaces) plus PrimeFaces 14 |
| Persistence | Spring Data JPA and Hibernate |
| Cloud | AWS SDK v2 S3 client |
| Database | MySQL 8, schema managed by hand-written SQL |
The stack is conventional, with one deliberate exception. Pairing JSF with Spring Boot 3.5 is unusual in 2026, since most new Spring projects reach for Thymeleaf or a single-page frontend. The leftovers agree: application.properties still carries spring.thymeleaf.cache=false even though no Thymeleaf dependency exists. The view layer changed at some point, and the config never caught up.
The Checkout Is One Transaction Wide
CompraServicio.realizarCompra is a single @Transactional method. It opens a database transaction, loops over the cart lines, records an outbound inventory movement for each line (which throws if stock would go negative), attaches a priced order line, and saves the order. If any line throws, the entire method rolls back: every movement, every decrement, every line vanishes together.
That is the whole trick. There is no compensation logic, no retry queue, no saga orchestration, no distributed transaction manager. The database already has a mechanism for do all of this or none of it, and the code simply uses it. For a single-database order system, this is not a shortcut. It is the correct answer, and it is the most interesting decision in the repository.
@Transactional
public Carrito realizarCompra(String usuario, Map<Integer, Integer> cantidades) {
Carrito orden = new Carrito(usuario);
for (Map.Entry<Integer, Integer> item : cantidades.entrySet()) {
movimientoInventarioServicio.registrar(productoId, TipoMovimiento.SALIDA, cantidad);
Producto producto = productoRepositorio.findById(productoId)
.orElseThrow(() -> new IllegalArgumentException("El producto ya no existe."));
orden.getProductos().add(new CarritoProducto(orden, cantidad, producto));
}
return carritoRepositorio.save(orden);
}
The schema rewards the same instinct. carrito_producto.precioUnitario stores the price at the moment of purchase, so a later price change never rewrites order history. The order table is even named carrito (cart), which is misleading, since its rows are completed orders rather than working carts. The naming wobbles, but the price snapshot is standard, correct practice.
The Switch That Moves Your Images to the Cloud
The second clever idea is quieter. A single property, app.imagenes.almacenamiento, selects where product images live. Set it to local and files sit on disk. Point it at S3 and they travel to a bucket. The rest of the application never learns which one is active.
app.imagenes.almacenamiento=${IMAGENES_ALMACENAMIENTO:local}
aws.region=${AWS_REGION:us-east-2}
aws.s3.bucket=${S3_BUCKET:}
Two details make it hold together. First, images are delivered through ImagenServlet, a raw @WebServlet that runs outside the JSF lifecycle, so swapping the backend does not disturb the view framework. Second, the database stores a storage key rather than a full URL. Changing the storage target never requires a data migration, because no row ever recorded where the bytes were.
Where the Seams Show
The transaction's guarantee has edges, and the same philosophy that makes the checkout correct is missing at three of them.
The first seam is concurrency. The stock check reads producto.getStock() into memory, computes a new value, and saves it. There is no pessimistic lock, no @Version optimistic lock on the product, and no conditional UPDATE ... WHERE stock >= ?. Two concurrent checkouts for the last unit can both read the same stock, both pass the check, and both write, with one overwriting the other. The purchase path is unprotected under load. It is worth noting the codebase contains an atomic repository method, updateStock, which the purchase path simply does not call.
The second seam is the foreign keys, and they disagree with each other. fk_cp_producto carries only ON UPDATE CASCADE, with no ON DELETE clause, so a product that has ever been sold cannot be deleted. But fk_movimiento_producto is ON DELETE CASCADE, so deleting a product silently erases its inventory history. One rule protects the sales record; the other destroys the stock ledger. The design never decides which history deserves to survive.
The third seam is secrets. The usuario.password column stores what the user typed, in plaintext, and the schema seeds an admin account with the password admin123. The committed application.properties also ships working-looking database defaults on a nonstandard port. These are exactly the shortcuts a course deadline encourages and a production review rejects.
What a Production Store Would Do Differently
None of this is a gotcha against a student project. It is a pattern, and the pattern is legible when you line the choices up against what a production team would reach for.
| Dimension | This repo | Production answer |
|---|---|---|
| Checkout integrity | One @Transactional method, rollback on any failure | Same. This is the correct call. |
| Concurrent stock | Read, compute, write. No lock. | Pessimistic row lock or UPDATE ... WHERE stock >= ? |
| Secrets | Committed password default, seeded admin123 | Environment variables and a secret manager |
| Schema | Hand-written SQL, ddl-auto=none | Versioned migrations (Flyway, Liquibase) |
Three rows where the repo falls short, one where it gets the hardest part right. That ratio is the point. The checkout, the piece that decides whether money and inventory stay consistent, is solved. The pieces around it, which a course never stressed, are not.
The Exam Was the Point
A small academic project got the hardest part of an order system right, and it did so by knowing which layer should own the problem. The lesson is not that student code is bad. It is that one well-placed transaction is worth more than a pile of application logic, and that the places where the code stops trusting the database are exactly the places it starts to break. That is a better exam answer than the name suggests.





