Reduce the pain of middleware migration.
silver-bullet-cache ็ผๅญ้้
Middleware |
get(key) |
set(key, value) |
get(key, loader) |
Guava |
โ
|
โ
|
โ
|
Redis |
โ
|
โ
|
โ |
Code Example
silver-bullet-database ๆฐๆฎๅบ้้
Middleware |
Transaction |
JPA NamedQuery |
JDBC |
โ
|
โ
|
Elasticsearch |
โ |
โ
|
public interface TestRepository extends JpaRepository<Test, Long> {
List<Test> findByName(String name);
// means select * from test where name = ?
}
Code Example
silver-bullet-json JSON้้
Middleware |
Serialize |
Deserialize |
PartialObjectParse |
FastJSON 2 |
โ
|
โ
|
โ
|
Jackson |
โ
|
โ
|
Coming soon |
GSON |
Coming soon |
Coming soon |
Coming soon |
Code Example
@Test
public void testPartialStr() {
JSONObject jsonObject = JSON.partialToObject("{\"name\": \"Alice\", \"age\": 30, \"city\": \"New Yor");
String city = (String) jsonObject.get("city");
Assertions.assertEquals("New Yor", city);
}
silver-bullet-lock ้้้
Middleware |
Lock / Unlock |
TryLock |
Redis |
โ
|
โ
|
Zookeeper |
Coming soon |
Coming soon |
Redis Code Example