mirror of
https://github.com/google/nomulus.git
synced 2025-07-04 10:13:30 +02:00
* Refactor PremiumList storage and retrieval for dual-database setup Previously, the storage and retrieval code was scattered across various places haphazardly and there was no good way to set up dual database access. This reorganizes the code so that retrieval is simpler and it allows for dual-write and dual-read. This includes the following changes: - Move all static / object retrieval code out of PremiumList -- the class should solely consist of its data and methods on its data and it shouldn't have to worry about complicated caching or retrieval - Split all PremiumList retrieval methods into PremiumListDatastoreDao and PremiumListSqlDao that handle retrieval of the premium list entry objects from the corresponding databases (since the way the actual data itself is stored is not the same between the two - Create a dual-DAO for PremiumList retrieval that branches between SQL/Datastore depending on which is appropriate -- it will read from and write to both but only log errors for the secondary DB - Cache the mapping from name to premium list in the dual-DAO. This is a common code path regardless of database so we can cache it at a high level - Cache the ways to go from premium list -> premium entries in the Datastore and SQL DAOs. These caches are specific to the corresponding DB and should thus be stored in the corresponding DAO. - Moves the database-choosing code from the actions to the lower-level dual-DAO. This is because we will often wish to access this premium list data in flows and all accesses should use the proper DB-selecting code |
||
---|---|---|
.. | ||
gradle/dependency-locks | ||
src | ||
WEB-INF/appengine-generated | ||
build.gradle | ||
Dockerfile | ||
karma.conf.js |