Baratine Is the new distributed , Memory based Java The service platform , Can build high-performance Web service , In the same JVM Combine data and logic . stay Baratine in , Data and services are one , The service has its own data :
The data does not belong to the database
Data cannot be modified by other processes
Data is not service independent
=> Data and service are in the same JVM, Same thread , The same class instance .
Baratine Far more than NoSQL,Baratine yes NoDB..
Baratine Components included :
Inbox: ring-buffer queue
Journal
Distributed SQL-compatible database
BFS (Baratine File System): distributed file system
Bartender: cloud manager with heartbeats
Horizontal scaling with automatic partitioning
Web server
POJO class :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
@ResourceService
(
"/counter/{_id}"
)
public
class
CounterService
{
private
long
_id;
private
long
_count;
public
long
get()
{
return
_count;
}
@Modify
public
long
incrementAndGet()
{
return
++_count;
}
@Modify
public
long
decrementAndGet()
{
return
--_count;
}
@Modify
public
long
addAndGet(
long
value)
{
_count += value;
return
_count;
}
}
|