forked from ServiceWeaver/weaver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
208 lines (186 loc) · 5.5 KB
/
index.html
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
<!--
Copyright 2022 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<div id="serviceweaver-jumbotron">
<h1>
Write your application as a <strong>modular binary</strong>. Deploy it
as a set of <em>microservices</em>.
</h1>
<p class="serviceweaver-subtitle">
Service Weaver is a programming framework for writing and deploying cloud
applications.
</p>
<a href="docs.html">Read the Docs</a>
</div>
<div class="intro-row">
<div class="intro-col">
<h1>Step 1: Split Your Application Into Components</h1>
<p>
Split your application into <strong>components</strong> written as regular
Go interfaces. Don't fuss with any networking or serialization code. Focus
on your business logic.
</p>
</div>
<div class="intro-col">
<markdown>
```go
type Adder interface {
Add(context.Context, int, int) (int, error)
}
type adder struct{
weaver.Implements[Adder]
}
func (adder) Add(_ context.Context, x, y int) (int, error) {
return x + y, nil
}
```
</markdown>
</div>
</div>
<div class="intro-row">
<div class="intro-col">
<h1>Step 2: Call Your Components</h1>
<p>
Call your components using regular Go method calls. No need for RPCs or
HTTP requests. Forget about versioning issues. The type system guarantees
<strong>components are compatible</strong>.
</p>
</div>
<div class="intro-col">
<markdown>
```go
var adder Adder = ... // See documentation
sum, err := adder.Add(ctx, 1, 2)
</markdown>
</div>
</div>
<div class="intro-row">
<div class="intro-col">
<h1>Step 3: Deploy Your Components</h1>
<p>
Test your app locally and deploy it to the cloud. Service Weaver lets you think
about <strong>what</strong> your code does without worrying about
<strong>where</strong> it's running.
</p>
</div>
<div class="intro-col">
<markdown>
```shell
$ go test . # Test locally.
$ go run . # Run locally.
$ weaver ssh deploy weaver.toml # Run on multiple machines.
$ weaver gke deploy weaver.toml # Run on Google Cloud.
$ weaver kube deploy weaver.toml # Run on Kubernetes.
</markdown>
</div>
</div>
<div class="intro-row">
<div class="intro-col">
<h1>Step 4: Place Your Components</h1>
<p>
Run your components <strong>wherever you want</strong>: in the same process
or on different machines. Run <strong>as many replicas as you
want</strong>; scale up or down to match load.
</p>
</div>
<div class="intro-col">
<!-- This SVG is populated by /assets/js/placement.js. -->
<svg id="placement" viewBox="-30 0 200 100"></svg>
</div>
</div>
<h1 id="feature-heading">Features</h1>
<div class="feature-list">
<div class="feature-col">
<div class="feature-bubble">
<h2><a href="docs.html#serializable-types">Highly Performant ⚡</a></h2>
<p>
Co-located components communicate via <strong>direct method
call</strong>. Remote components communicate using highly-efficient
custom serialization and RPC protocols.
<!--TODO(mwhittaker): Add performance numbers.-->
<!--TODO(mwhittaker): Replace code with graph.-->
</p>
<markdown>
```go
// Automatically encoded and decoded.
type pair struct {
weaver.AutoMarshal
x, y int32
}
</markdown>
</div>
</div>
<div class="feature-col">
<div class="feature-bubble">
<h2><a href="docs.html#config-files">Tiny Config 🎛️</a></h2>
<p>
Deploy to the cloud <strong>without tons of boilerplate</strong>
configuration. Here's a working config file to deploy a Service Weaver application
across two regions in Google Cloud. It's less than ten lines long.
</p>
<markdown>
```toml
[serviceweaver]
binary = "./example"
[gke]
regions = ["us-west1", "us-east1"]
listeners.example = {public_hostname = "example.com"},
</markdown>
</div>
</div>
<div class="feature-col">
<div class="feature-bubble">
<h2><a href="docs.html#logging">Logging, Metrics, Tracing 🔎</a></h2>
<p>
Service Weaver has libraries for logging, metrics, and tracing. This telemetry is
<strong>automatically integrated</strong> into the cloud where you
deploy.
</p>
<markdown>
```go
var count = metrics.NewCounter(
"example_count",
"An example of a Service Weaver counter",
)
func main() {
count.Add(1)
// ...
}
</markdown>
</div>
</div>
<div class="feature-col">
<div class="feature-bubble">
<h2><a href="docs.html#routing">Sharding 🗃️</a></h2>
<p>
Shard requests across different component replicas.
</p>
<markdown>
```go
type Cache interface {
Get(ctx context.Context, key string) (string, error)
Put(ctx context.Context, key, val string) error
}
// router defines how Cache methods are routed.
type router struct{}
func (router) Get(_ context.Context, k string) string {
return k
}
func (router) Put(_ context.Context, k, _ string) string {
return k
}
</markdown>
</div>
</div>
</div>
<script src="assets/js/snap.svg-min.js"></script>
<script src="assets/js/placement.js"></script>