You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2018/07/19 03:24:02 UTC

[GitHub] wu-sheng closed pull request #1472: [OAP Server] Core framework

wu-sheng closed pull request #1472: [OAP Server] Core framework
URL: https://github.com/apache/incubator-skywalking/pull/1472
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/oap-server/pom.xml b/oap-server/pom.xml
index de56d23fc..6aeaac093 100644
--- a/oap-server/pom.xml
+++ b/oap-server/pom.xml
@@ -30,9 +30,11 @@
     <artifactId>oap-server</artifactId>
     <packaging>pom</packaging>
     <modules>
+        <module>server-core</module>
+        <module>server-receiver-plugin</module>
         <module>server-cluster-plugin</module>
+        <module>server-storage-plugin</module>
         <module>server-library</module>
-        <module>server-core</module>
         <module>server-starter</module>
     </modules>
 
@@ -45,6 +47,13 @@
         <gson.version>2.8.1</gson.version>
         <graphql-java-tools.version>4.3.0</graphql-java-tools.version>
         <zookeeper.version>3.4.10</zookeeper.version>
+        <grpc.version>1.10.0</grpc.version>
+        <jetty.version>9.4.2.v20170220</jetty.version>
+        <lombok.version>1.18.0</lombok.version>
+        <h2.version>1.4.196</h2.version>
+        <shardingjdbc.version>2.0.3</shardingjdbc.version>
+        <commons-dbcp.version>1.4</commons-dbcp.version>
+        <elasticsearch.version>6.3.1</elasticsearch.version>
     </properties>
 
     <dependencies>
@@ -74,6 +83,10 @@
             <groupId>com.google.guava</groupId>
             <artifactId>guava</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+        </dependency>
     </dependencies>
 
     <dependencyManagement>
@@ -108,6 +121,11 @@
                 <artifactId>gson</artifactId>
                 <version>${gson.version}</version>
             </dependency>
+            <dependency>
+                <groupId>com.h2database</groupId>
+                <artifactId>h2</artifactId>
+                <version>${h2.version}</version>
+            </dependency>
             <dependency>
                 <groupId>joda-time</groupId>
                 <artifactId>joda-time</artifactId>
@@ -115,42 +133,8 @@
             </dependency>
             <dependency>
                 <groupId>org.elasticsearch.client</groupId>
-                <artifactId>transport</artifactId>
-                <version>${elasticsearch.client.version}</version>
-                <exclusions>
-                    <exclusion>
-                        <artifactId>snakeyaml</artifactId>
-                        <groupId>org.yaml</groupId>
-                    </exclusion>
-                    <exclusion>
-                        <artifactId>netty-common</artifactId>
-                        <groupId>io.netty</groupId>
-                    </exclusion>
-                    <exclusion>
-                        <artifactId>netty-transport</artifactId>
-                        <groupId>io.netty</groupId>
-                    </exclusion>
-                    <exclusion>
-                        <artifactId>netty-codec</artifactId>
-                        <groupId>io.netty</groupId>
-                    </exclusion>
-                    <exclusion>
-                        <artifactId>netty-codec-http</artifactId>
-                        <groupId>io.netty</groupId>
-                    </exclusion>
-                    <exclusion>
-                        <artifactId>netty-buffer</artifactId>
-                        <groupId>io.netty</groupId>
-                    </exclusion>
-                    <exclusion>
-                        <artifactId>netty-handler</artifactId>
-                        <groupId>io.netty</groupId>
-                    </exclusion>
-                    <exclusion>
-                        <artifactId>netty-resolver</artifactId>
-                        <groupId>io.netty</groupId>
-                    </exclusion>
-                </exclusions>
+                <artifactId>elasticsearch-rest-client</artifactId>
+                <version>${elasticsearch.version}</version>
             </dependency>
             <dependency>
                 <groupId>org.apache.zookeeper</groupId>
@@ -188,6 +172,58 @@
                     </exclusion>
                 </exclusions>
             </dependency>
+            <dependency>
+                <groupId>io.grpc</groupId>
+                <artifactId>grpc-core</artifactId>
+                <version>${grpc.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>io.grpc</groupId>
+                <artifactId>grpc-netty</artifactId>
+                <version>${grpc.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>io.grpc</groupId>
+                <artifactId>grpc-protobuf</artifactId>
+                <version>${grpc.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>io.grpc</groupId>
+                <artifactId>grpc-stub</artifactId>
+                <version>${grpc.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>io.grpc</groupId>
+                <artifactId>grpc-testing</artifactId>
+                <version>${grpc.version}</version>
+                <scope>test</scope>
+            </dependency>
+            <dependency>
+                <groupId>org.eclipse.jetty</groupId>
+                <artifactId>jetty-server</artifactId>
+                <version>${jetty.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.eclipse.jetty</groupId>
+                <artifactId>jetty-servlet</artifactId>
+                <version>${jetty.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.projectlombok</groupId>
+                <artifactId>lombok</artifactId>
+                <version>${lombok.version}</version>
+                <scope>provided</scope>
+            </dependency>
+            <dependency>
+                <groupId>io.shardingjdbc</groupId>
+                <artifactId>sharding-jdbc-core</artifactId>
+                <version>${shardingjdbc.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>commons-dbcp</groupId>
+                <artifactId>commons-dbcp</artifactId>
+                <version>${commons-dbcp.version}</version>
+            </dependency>
         </dependencies>
     </dependencyManagement>
 </project>
\ No newline at end of file
diff --git a/oap-server/server-cluster-plugin/cluster-standalone-plugin/pom.xml b/oap-server/server-cluster-plugin/cluster-standalone-plugin/pom.xml
index 743028f8c..c1269ae81 100644
--- a/oap-server/server-cluster-plugin/cluster-standalone-plugin/pom.xml
+++ b/oap-server/server-cluster-plugin/cluster-standalone-plugin/pom.xml
@@ -33,7 +33,7 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.skywalking</groupId>
-            <artifactId>core-cluster</artifactId>
+            <artifactId>server-core</artifactId>
             <version>${project.version}</version>
         </dependency>
     </dependencies>
diff --git a/oap-server/server-cluster-plugin/cluster-zookeeper-plugin/pom.xml b/oap-server/server-cluster-plugin/cluster-zookeeper-plugin/pom.xml
index 0fab89c84..0ba6843d0 100644
--- a/oap-server/server-cluster-plugin/cluster-zookeeper-plugin/pom.xml
+++ b/oap-server/server-cluster-plugin/cluster-zookeeper-plugin/pom.xml
@@ -38,7 +38,7 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.skywalking</groupId>
-            <artifactId>core-cluster</artifactId>
+            <artifactId>server-core</artifactId>
             <version>${project.version}</version>
         </dependency>
         <dependency>
diff --git a/oap-server/server-core/pom.xml b/oap-server/server-core/pom.xml
index 37ad39cc4..767e1c8bd 100644
--- a/oap-server/server-core/pom.xml
+++ b/oap-server/server-core/pom.xml
@@ -28,10 +28,7 @@
     <modelVersion>4.0.0</modelVersion>
 
     <artifactId>server-core</artifactId>
-    <packaging>pom</packaging>
-    <modules>
-        <module>core-cluster</module>
-    </modules>
+    <packaging>jar</packaging>
 
     <dependencies>
         <dependency>
@@ -44,5 +41,20 @@
             <artifactId>library-util</artifactId>
             <version>${project.version}</version>
         </dependency>
+        <dependency>
+            <groupId>org.apache.skywalking</groupId>
+            <artifactId>library-server</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.skywalking</groupId>
+            <artifactId>apm-network</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.skywalking</groupId>
+            <artifactId>apm-datacarrier</artifactId>
+            <version>${project.version}</version>
+        </dependency>
     </dependencies>
 </project>
\ No newline at end of file
diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/CoreModule.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/CoreModule.java
new file mode 100644
index 000000000..6f3de4875
--- /dev/null
+++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/CoreModule.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.core;
+
+import java.util.*;
+import org.apache.skywalking.oap.server.core.receiver.SourceReceiver;
+import org.apache.skywalking.oap.server.core.server.*;
+import org.apache.skywalking.oap.server.library.module.ModuleDefine;
+
+/**
+ * @author peng-yongsheng
+ */
+public class CoreModule extends ModuleDefine {
+
+    public static final String NAME = "core";
+
+    @Override public String name() {
+        return NAME;
+    }
+
+    @Override public Class[] services() {
+        List<Class> classes = new ArrayList<>();
+        addServerInterface(classes);
+        addReceiverInterface(classes);
+
+        return classes.toArray(new Class[] {});
+    }
+
+    private void addServerInterface(List<Class> classes) {
+        classes.add(GRPCHandlerRegister.class);
+        classes.add(JettyHandlerRegister.class);
+    }
+
+    private void addReceiverInterface(List<Class> classes) {
+        classes.add(SourceReceiver.class);
+    }
+}
diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/CoreModuleConfig.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/CoreModuleConfig.java
new file mode 100644
index 000000000..f781a8c46
--- /dev/null
+++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/CoreModuleConfig.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.core;
+
+import lombok.*;
+import org.apache.skywalking.oap.server.library.module.ModuleConfig;
+
+/**
+ * @author peng-yongsheng
+ */
+public class CoreModuleConfig extends ModuleConfig {
+    @Setter @Getter private String restHost;
+    @Setter @Getter private int restPort;
+    @Setter @Getter private String restContextPath;
+    @Setter @Getter private String gRPCHost;
+    @Setter @Getter private int gRPCPort;
+}
diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/CoreModuleProvider.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/CoreModuleProvider.java
new file mode 100644
index 000000000..030742a77
--- /dev/null
+++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/CoreModuleProvider.java
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.core;
+
+import org.apache.skywalking.oap.server.core.cluster.*;
+import org.apache.skywalking.oap.server.core.receiver.*;
+import org.apache.skywalking.oap.server.core.server.*;
+import org.apache.skywalking.oap.server.library.module.*;
+import org.apache.skywalking.oap.server.library.server.ServerException;
+import org.apache.skywalking.oap.server.library.server.grpc.GRPCServer;
+import org.apache.skywalking.oap.server.library.server.jetty.JettyServer;
+import org.slf4j.*;
+
+/**
+ * @author peng-yongsheng
+ */
+public class CoreModuleProvider extends ModuleProvider {
+
+    private static final Logger logger = LoggerFactory.getLogger(CoreModuleProvider.class);
+
+    private final CoreModuleConfig moduleConfig;
+    private GRPCServer grpcServer;
+    private JettyServer jettyServer;
+
+    public CoreModuleProvider() {
+        super();
+        this.moduleConfig = new CoreModuleConfig();
+    }
+
+    @Override public String name() {
+        return "default";
+    }
+
+    @Override public Class module() {
+        return CoreModule.class;
+    }
+
+    @Override public ModuleConfig createConfigBeanIfAbsent() {
+        return moduleConfig;
+    }
+
+    @Override public void prepare() throws ServiceNotProvidedException {
+        grpcServer = new GRPCServer(moduleConfig.getGRPCHost(), moduleConfig.getGRPCPort());
+        grpcServer.initialize();
+
+        jettyServer = new JettyServer(moduleConfig.getRestHost(), moduleConfig.getRestPort(), moduleConfig.getRestContextPath());
+        jettyServer.initialize();
+
+        this.registerServiceImplementation(GRPCHandlerRegister.class, new GRPCHandlerRegisterImpl(grpcServer));
+        this.registerServiceImplementation(JettyHandlerRegister.class, new JettyHandlerRegisterImpl(jettyServer));
+
+        this.registerServiceImplementation(SourceReceiver.class, new SourceReceiverImpl());
+    }
+
+    @Override public void start() throws ModuleStartException {
+        try {
+            grpcServer.start();
+            jettyServer.start();
+        } catch (ServerException e) {
+            throw new ModuleStartException(e.getMessage(), e);
+        }
+    }
+
+    @Override public void notifyAfterCompleted() {
+        InstanceDetails gRPCServerInstance = new InstanceDetails();
+        gRPCServerInstance.setHost(moduleConfig.getGRPCHost());
+        gRPCServerInstance.setPort(moduleConfig.getGRPCPort());
+        this.getManager().find(ClusterModule.NAME).getService(ModuleRegister.class).register(CoreModule.NAME, "gRPC", gRPCServerInstance);
+
+        InstanceDetails restServerInstance = new InstanceDetails();
+        restServerInstance.setHost(moduleConfig.getRestHost());
+        restServerInstance.setPort(moduleConfig.getRestPort());
+        restServerInstance.setContextPath(moduleConfig.getRestContextPath());
+        this.getManager().find(ClusterModule.NAME).getService(ModuleRegister.class).register(CoreModule.NAME, "rest", restServerInstance);
+    }
+}
diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/AbstractAggregator.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/AbstractAggregator.java
new file mode 100644
index 000000000..ea8a692ce
--- /dev/null
+++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/AbstractAggregator.java
@@ -0,0 +1,124 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.core.analysis;
+
+import java.util.*;
+import org.apache.skywalking.apm.commons.datacarrier.DataCarrier;
+import org.apache.skywalking.apm.commons.datacarrier.consumer.IConsumer;
+import org.apache.skywalking.oap.server.core.analysis.data.*;
+import org.slf4j.*;
+
+/**
+ * @author peng-yongsheng
+ */
+public abstract class AbstractAggregator<INPUT extends StreamData> {
+
+    private static final Logger logger = LoggerFactory.getLogger(AbstractAggregator.class);
+
+    private final DataCarrier<INPUT> dataCarrier;
+    private final MergeDataCache<INPUT> mergeDataCache;
+    private int messageNum;
+
+    public AbstractAggregator() {
+        this.mergeDataCache = new MergeDataCache<>();
+        this.dataCarrier = new DataCarrier<>(1, 10000);
+        this.dataCarrier.consume(new AggregatorConsumer(this), 1);
+    }
+
+    public void in(INPUT message) {
+        message.setEndOfBatchContext(new EndOfBatchContext(false));
+        dataCarrier.produce(message);
+    }
+
+    private void onWork(INPUT message) {
+        messageNum++;
+        aggregate(message);
+
+        if (messageNum >= 1000 || message.getEndOfBatchContext().isEndOfBatch()) {
+            sendToNext();
+            messageNum = 0;
+        }
+    }
+
+    private void sendToNext() {
+        mergeDataCache.switchPointer();
+        while (mergeDataCache.getLast().isWriting()) {
+            try {
+                Thread.sleep(10);
+            } catch (InterruptedException e) {
+                logger.error(e.getMessage(), e);
+            }
+        }
+
+        mergeDataCache.getLast().collection().forEach((INPUT key, INPUT data) -> {
+            if (logger.isDebugEnabled()) {
+                logger.debug(data.toString());
+            }
+
+            onNext(data);
+        });
+        mergeDataCache.finishReadingLast();
+    }
+
+    protected abstract void onNext(INPUT data);
+
+    private void aggregate(INPUT message) {
+        mergeDataCache.writing();
+        if (mergeDataCache.containsKey(message)) {
+//            mergeDataCache.get(message).mergeAndFormulaCalculateData(message);
+        } else {
+            mergeDataCache.put(message);
+        }
+        mergeDataCache.finishWriting();
+    }
+
+    private class AggregatorConsumer implements IConsumer<INPUT> {
+
+        private final AbstractAggregator<INPUT> aggregator;
+
+        private AggregatorConsumer(AbstractAggregator<INPUT> aggregator) {
+            this.aggregator = aggregator;
+        }
+
+        @Override public void init() {
+
+        }
+
+        @Override public void consume(List<INPUT> data) {
+            Iterator<INPUT> inputIterator = data.iterator();
+
+            int i = 0;
+            while (inputIterator.hasNext()) {
+                INPUT input = inputIterator.next();
+                i++;
+                if (i == data.size()) {
+                    input.getEndOfBatchContext().setEndOfBatch(true);
+                }
+                aggregator.onWork(input);
+            }
+        }
+
+        @Override public void onError(List<INPUT> data, Throwable t) {
+            logger.error(t.getMessage(), t);
+        }
+
+        @Override public void onExit() {
+        }
+    }
+}
diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/AvgIndicate.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/AvgIndicate.java
new file mode 100644
index 000000000..4aee7b19d
--- /dev/null
+++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/AvgIndicate.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.core.analysis;
+
+import lombok.*;
+
+/**
+ * @author peng-yongsheng
+ */
+public abstract class AvgIndicate extends Indicate {
+
+    @Setter @Getter private long times;
+    @Setter @Getter private long value;
+
+    public AvgIndicate(long timeBucket) {
+        super(timeBucket);
+        this.times = 1;
+    }
+
+    public long getAvg() {
+        return value / times;
+    }
+}
diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/DispatcherManager.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/DispatcherManager.java
new file mode 100644
index 000000000..de8da4e4e
--- /dev/null
+++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/DispatcherManager.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.core.analysis;
+
+import java.util.*;
+import org.apache.skywalking.oap.server.core.analysis.endpoint.EndpointDispatcher;
+import org.apache.skywalking.oap.server.core.receiver.Scope;
+import org.slf4j.*;
+
+/**
+ * @author peng-yongsheng
+ */
+public class DispatcherManager {
+
+    private static final Logger logger = LoggerFactory.getLogger(DispatcherManager.class);
+
+    private Map<Scope, SourceDispatcher> dispatcherMap;
+
+    public DispatcherManager() {
+        this.dispatcherMap = new HashMap<>();
+        this.dispatcherMap.put(Scope.Endpoint, new EndpointDispatcher());
+    }
+
+    public SourceDispatcher getDispatcher(Scope scope) {
+        return dispatcherMap.get(scope);
+    }
+}
diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/Indicate.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/Indicate.java
new file mode 100644
index 000000000..e0185a305
--- /dev/null
+++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/Indicate.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.core.analysis;
+
+import lombok.Getter;
+import org.apache.skywalking.oap.server.core.analysis.data.StreamData;
+
+/**
+ * @author peng-yongsheng
+ */
+public abstract class Indicate extends StreamData {
+
+    @Getter private final long timeBucket;
+
+    public Indicate(long timeBucket) {
+        this.timeBucket = timeBucket;
+    }
+}
diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/SourceDispatcher.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/SourceDispatcher.java
new file mode 100644
index 000000000..062601aaa
--- /dev/null
+++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/SourceDispatcher.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.core.analysis;
+
+import org.apache.skywalking.oap.server.core.receiver.Source;
+
+/**
+ * @author peng-yongsheng
+ */
+public interface SourceDispatcher<S extends Source> {
+    void dispatch(S source);
+}
diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/data/Collection.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/data/Collection.java
new file mode 100644
index 000000000..f1d52a800
--- /dev/null
+++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/data/Collection.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.core.analysis.data;
+
+/**
+ * @author peng-yongsheng
+ */
+public interface Collection<Data> {
+
+    void reading();
+
+    boolean isReading();
+
+    void writing();
+
+    boolean isWriting();
+
+    void clear();
+
+    int size();
+
+    void finishReading();
+
+    void finishWriting();
+
+    Data collection();
+}
diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/data/DataCache.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/data/DataCache.java
new file mode 100644
index 000000000..f26011e0c
--- /dev/null
+++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/data/DataCache.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.core.analysis.data;
+
+/**
+ * @author peng-yongsheng
+ */
+public interface DataCache {
+
+    void writing();
+
+    void finishWriting();
+}
diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/data/EndOfBatchContext.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/data/EndOfBatchContext.java
new file mode 100644
index 000000000..528ace957
--- /dev/null
+++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/data/EndOfBatchContext.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.core.analysis.data;
+
+/**
+ * @author peng-yongsheng
+ */
+public class EndOfBatchContext {
+
+    private boolean isEndOfBatch;
+
+    public EndOfBatchContext(boolean isEndOfBatch) {
+        this.isEndOfBatch = isEndOfBatch;
+    }
+
+    public boolean isEndOfBatch() {
+        return isEndOfBatch;
+    }
+
+    public void setEndOfBatch(boolean endOfBatch) {
+        isEndOfBatch = endOfBatch;
+    }
+}
diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/data/MergeDataCache.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/data/MergeDataCache.java
new file mode 100644
index 000000000..8ef0354ee
--- /dev/null
+++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/data/MergeDataCache.java
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.core.analysis.data;
+
+/**
+ * @author peng-yongsheng
+ */
+public class MergeDataCache<STREAM_DATA extends StreamData> extends Window<MergeDataCollection<STREAM_DATA>> implements DataCache {
+
+    private MergeDataCollection<STREAM_DATA> lockedMergeDataCollection;
+
+    @Override public MergeDataCollection<STREAM_DATA> collectionInstance() {
+        return new MergeDataCollection<>();
+    }
+
+    public boolean containsKey(STREAM_DATA key) {
+        return lockedMergeDataCollection.containsKey(key);
+    }
+
+    public StreamData get(STREAM_DATA key) {
+        return lockedMergeDataCollection.get(key);
+    }
+
+    public void put(STREAM_DATA data) {
+        lockedMergeDataCollection.put(data);
+    }
+
+    @Override public void writing() {
+        lockedMergeDataCollection = getCurrentAndWriting();
+    }
+
+    @Override public void finishWriting() {
+        lockedMergeDataCollection.finishWriting();
+        lockedMergeDataCollection = null;
+    }
+}
diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/data/MergeDataCollection.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/data/MergeDataCollection.java
new file mode 100644
index 000000000..07aa88c50
--- /dev/null
+++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/data/MergeDataCollection.java
@@ -0,0 +1,84 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.core.analysis.data;
+
+import java.util.*;
+
+/**
+ * @author peng-yongsheng
+ */
+public class MergeDataCollection<STREAM_DATA extends StreamData> implements Collection<Map<STREAM_DATA, STREAM_DATA>> {
+    private Map<STREAM_DATA, STREAM_DATA> data;
+    private volatile boolean writing;
+    private volatile boolean reading;
+
+    MergeDataCollection() {
+        this.data = new HashMap<>();
+        this.writing = false;
+        this.reading = false;
+    }
+
+    public void finishWriting() {
+        writing = false;
+    }
+
+    @Override public void writing() {
+        writing = true;
+    }
+
+    @Override public boolean isWriting() {
+        return writing;
+    }
+
+    @Override public void finishReading() {
+        reading = false;
+    }
+
+    @Override public void reading() {
+        reading = true;
+    }
+
+    @Override public boolean isReading() {
+        return reading;
+    }
+
+    boolean containsKey(STREAM_DATA key) {
+        return data.containsKey(key);
+    }
+
+    void put(STREAM_DATA value) {
+        data.put(value, value);
+    }
+
+    public STREAM_DATA get(STREAM_DATA key) {
+        return data.get(key);
+    }
+
+    @Override public int size() {
+        return data.size();
+    }
+
+    @Override public void clear() {
+        data.clear();
+    }
+
+    public Map<STREAM_DATA, STREAM_DATA> collection() {
+        return data;
+    }
+}
diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/data/NonMergeDataCache.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/data/NonMergeDataCache.java
new file mode 100644
index 000000000..5d4cf4366
--- /dev/null
+++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/data/NonMergeDataCache.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.core.analysis.data;
+
+/**
+ * @author peng-yongsheng
+ */
+public class NonMergeDataCache<STREAM_DATA extends StreamData> extends Window<NonMergeDataCollection<STREAM_DATA>> implements DataCache {
+
+    private NonMergeDataCollection<STREAM_DATA> lockedMergeDataCollection;
+
+    @Override public NonMergeDataCollection<STREAM_DATA> collectionInstance() {
+        return new NonMergeDataCollection<>();
+    }
+
+    public void add(STREAM_DATA data) {
+        lockedMergeDataCollection.add(data);
+    }
+
+    @Override public void writing() {
+        lockedMergeDataCollection = getCurrentAndWriting();
+    }
+
+    @Override public void finishWriting() {
+        lockedMergeDataCollection.finishWriting();
+        lockedMergeDataCollection = null;
+    }
+}
diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/data/NonMergeDataCollection.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/data/NonMergeDataCollection.java
new file mode 100644
index 000000000..7eabe479f
--- /dev/null
+++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/data/NonMergeDataCollection.java
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.core.analysis.data;
+
+import java.util.*;
+
+/**
+ * @author peng-yongsheng
+ */
+public class NonMergeDataCollection<STREAM_DATA extends StreamData> implements Collection<List<STREAM_DATA>> {
+
+    private final List<STREAM_DATA> data;
+    private volatile boolean writing;
+    private volatile boolean reading;
+
+    NonMergeDataCollection() {
+        this.data = new LinkedList<>();
+        this.writing = false;
+        this.reading = false;
+    }
+
+    public void finishWriting() {
+        writing = false;
+    }
+
+    @Override public void writing() {
+        writing = true;
+    }
+
+    @Override public boolean isWriting() {
+        return writing;
+    }
+
+    @Override public void finishReading() {
+        reading = false;
+    }
+
+    @Override public void reading() {
+        reading = true;
+    }
+
+    @Override public boolean isReading() {
+        return reading;
+    }
+
+    void add(STREAM_DATA value) {
+        data.add(value);
+    }
+
+    @Override public int size() {
+        return data.size();
+    }
+
+    @Override public void clear() {
+        data.clear();
+    }
+
+    public List<STREAM_DATA> collection() {
+        return data;
+    }
+}
diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/data/QueueData.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/data/QueueData.java
new file mode 100644
index 000000000..858e62de3
--- /dev/null
+++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/data/QueueData.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.core.analysis.data;
+
+/**
+ * @author peng-yongsheng
+ */
+public interface QueueData {
+
+    EndOfBatchContext getEndOfBatchContext();
+
+    void setEndOfBatchContext(EndOfBatchContext context);
+}
diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/data/RemoteData.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/data/RemoteData.java
new file mode 100644
index 000000000..fe4f1f5b5
--- /dev/null
+++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/data/RemoteData.java
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.core.analysis.data;
+
+/**
+ * @author peng-yongsheng
+ */
+public interface RemoteData {
+    String selectKey();
+}
diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/data/StreamData.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/data/StreamData.java
new file mode 100644
index 000000000..63f149f7b
--- /dev/null
+++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/data/StreamData.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.core.analysis.data;
+
+/**
+ * @author peng-yongsheng
+ */
+public abstract class StreamData implements QueueData {
+
+    private EndOfBatchContext endOfBatchContext;
+
+    @Override public final EndOfBatchContext getEndOfBatchContext() {
+        return this.endOfBatchContext;
+    }
+
+    @Override public final void setEndOfBatchContext(EndOfBatchContext context) {
+        this.endOfBatchContext = context;
+    }
+}
diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/data/Window.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/data/Window.java
new file mode 100644
index 000000000..38570b3e9
--- /dev/null
+++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/data/Window.java
@@ -0,0 +1,90 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.core.analysis.data;
+
+import java.util.concurrent.atomic.AtomicInteger;
+
+/**
+ * @author peng-yongsheng
+ */
+public abstract class Window<WINDOW_COLLECTION extends Collection> {
+
+    private AtomicInteger windowSwitch = new AtomicInteger(0);
+
+    private WINDOW_COLLECTION pointer;
+
+    private WINDOW_COLLECTION windowDataA;
+    private WINDOW_COLLECTION windowDataB;
+
+    protected Window() {
+        this.windowDataA = collectionInstance();
+        this.windowDataB = collectionInstance();
+        this.pointer = windowDataA;
+    }
+
+    public abstract WINDOW_COLLECTION collectionInstance();
+
+    public boolean trySwitchPointer() {
+        return windowSwitch.incrementAndGet() == 1 && !getLast().isReading();
+    }
+
+    public void trySwitchPointerFinally() {
+        windowSwitch.addAndGet(-1);
+    }
+
+    public void switchPointer() {
+        if (pointer == windowDataA) {
+            pointer = windowDataB;
+        } else {
+            pointer = windowDataA;
+        }
+        getLast().reading();
+    }
+
+    protected WINDOW_COLLECTION getCurrentAndWriting() {
+        if (pointer == windowDataA) {
+            windowDataA.writing();
+            return windowDataA;
+        } else {
+            windowDataB.writing();
+            return windowDataB;
+        }
+    }
+
+    private WINDOW_COLLECTION getCurrent() {
+        return pointer;
+    }
+
+    public int currentCollectionSize() {
+        return getCurrent().size();
+    }
+
+    public WINDOW_COLLECTION getLast() {
+        if (pointer == windowDataA) {
+            return windowDataB;
+        } else {
+            return windowDataA;
+        }
+    }
+
+    public void finishReadingLast() {
+        getLast().clear();
+        getLast().finishReading();
+    }
+}
diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/endpoint/EndpointAvgAggregator.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/endpoint/EndpointAvgAggregator.java
new file mode 100644
index 000000000..526135a8e
--- /dev/null
+++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/endpoint/EndpointAvgAggregator.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.core.analysis.endpoint;
+
+import org.apache.skywalking.oap.server.core.analysis.AbstractAggregator;
+import org.slf4j.*;
+
+/**
+ * @author peng-yongsheng
+ */
+public class EndpointAvgAggregator extends AbstractAggregator<EndpointAvgIndicate> {
+
+    private static final Logger logger = LoggerFactory.getLogger(EndpointAvgAggregator.class);
+
+    @Override protected void onNext(EndpointAvgIndicate data) {
+
+    }
+}
diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/endpoint/EndpointAvgIndicate.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/endpoint/EndpointAvgIndicate.java
new file mode 100644
index 000000000..159728c38
--- /dev/null
+++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/endpoint/EndpointAvgIndicate.java
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.core.analysis.endpoint;
+
+import lombok.Getter;
+import org.apache.skywalking.oap.server.core.analysis.AvgIndicate;
+
+/**
+ * @author peng-yongsheng
+ */
+public class EndpointAvgIndicate extends AvgIndicate {
+
+    @Getter private final int id;
+
+    public EndpointAvgIndicate(int id, long timeBucket) {
+        super(timeBucket);
+        this.id = id;
+    }
+
+    public void setLatency(long latency) {
+        setValue(latency);
+    }
+
+    public long getLatency() {
+        return getValue();
+    }
+
+    @Override public int hashCode() {
+        int result = 17;
+        result = 31 * result + id;
+        //TODO How?
+//        result = 31 * result + getTimeBucket();
+        return result;
+    }
+
+    @Override public boolean equals(Object obj) {
+        if (this == obj)
+            return true;
+        if (obj == null)
+            return false;
+        if (getClass() != obj.getClass())
+            return false;
+
+        EndpointAvgIndicate indicate = (EndpointAvgIndicate)obj;
+        if (id != indicate.id)
+            return false;
+        if (getTimeBucket() != indicate.getTimeBucket())
+            return false;
+
+        return true;
+    }
+}
diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/endpoint/EndpointDispatcher.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/endpoint/EndpointDispatcher.java
new file mode 100644
index 000000000..8d6c065de
--- /dev/null
+++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/endpoint/EndpointDispatcher.java
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.core.analysis.endpoint;
+
+import org.apache.skywalking.oap.server.core.analysis.SourceDispatcher;
+import org.apache.skywalking.oap.server.core.receiver.Endpoint;
+
+/**
+ * @author peng-yongsheng
+ */
+public class EndpointDispatcher implements SourceDispatcher<Endpoint> {
+
+    private final EndpointAvgAggregator avgAggregator;
+
+    public EndpointDispatcher() {
+        this.avgAggregator = new EndpointAvgAggregator();
+    }
+
+    @Override public void dispatch(Endpoint source) {
+        avg(source);
+    }
+
+    private void avg(Endpoint source) {
+        EndpointAvgIndicate indicate = new EndpointAvgIndicate(source.getId(), source.getTimeBucket());
+        indicate.setLatency(source.getLatency());
+
+        avgAggregator.in(indicate);
+    }
+}
diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/cluster/ClusterModule.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/cluster/ClusterModule.java
new file mode 100644
index 000000000..992ed10d4
--- /dev/null
+++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/cluster/ClusterModule.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.core.cluster;
+
+import org.apache.skywalking.oap.server.library.module.ModuleDefine;
+
+/**
+ * @author peng-yongsheng
+ */
+public class ClusterModule extends ModuleDefine {
+
+    public static final String NAME = "cluster";
+
+    @Override public String name() {
+        return NAME;
+    }
+
+    @Override public Class[] services() {
+        return new Class[] {ModuleRegister.class, ModuleQuery.class};
+    }
+}
diff --git a/oap-server/server-core/core-cluster/src/main/java/org/apache/skywalking/oap/server/core/cluster/InstanceDetails.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/cluster/InstanceDetails.java
similarity index 100%
rename from oap-server/server-core/core-cluster/src/main/java/org/apache/skywalking/oap/server/core/cluster/InstanceDetails.java
rename to oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/cluster/InstanceDetails.java
diff --git a/oap-server/server-core/core-cluster/src/main/java/org/apache/skywalking/oap/server/core/cluster/ModuleQuery.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/cluster/ModuleQuery.java
similarity index 100%
rename from oap-server/server-core/core-cluster/src/main/java/org/apache/skywalking/oap/server/core/cluster/ModuleQuery.java
rename to oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/cluster/ModuleQuery.java
diff --git a/oap-server/server-core/core-cluster/src/main/java/org/apache/skywalking/oap/server/core/cluster/ModuleRegister.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/cluster/ModuleRegister.java
similarity index 100%
rename from oap-server/server-core/core-cluster/src/main/java/org/apache/skywalking/oap/server/core/cluster/ModuleRegister.java
rename to oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/cluster/ModuleRegister.java
diff --git a/oap-server/server-core/core-cluster/src/main/java/org/apache/skywalking/oap/server/core/cluster/ServiceRegisterException.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/cluster/ServiceRegisterException.java
similarity index 93%
rename from oap-server/server-core/core-cluster/src/main/java/org/apache/skywalking/oap/server/core/cluster/ServiceRegisterException.java
rename to oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/cluster/ServiceRegisterException.java
index 901c60641..9d83d304d 100644
--- a/oap-server/server-core/core-cluster/src/main/java/org/apache/skywalking/oap/server/core/cluster/ServiceRegisterException.java
+++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/cluster/ServiceRegisterException.java
@@ -21,7 +21,7 @@
 /**
  * @author peng-yongsheng
  */
-public class ServiceRegisterException extends Exception {
+public class ServiceRegisterException extends RuntimeException {
 
     public ServiceRegisterException(String message) {
         super(message);
diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/receiver/Endpoint.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/receiver/Endpoint.java
new file mode 100644
index 000000000..24fe14d2a
--- /dev/null
+++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/receiver/Endpoint.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.core.receiver;
+
+import lombok.*;
+import org.apache.skywalking.apm.network.language.agent.SpanLayer;
+
+/**
+ * @author peng-yongsheng
+ */
+public class Endpoint extends Source {
+    @Override public Scope scope() {
+        return Scope.Endpoint;
+    }
+
+    @Getter @Setter private int id;
+    @Getter @Setter private String name;
+    @Getter @Setter private String serviceName;
+    @Getter @Setter private String serviceInstanceName;
+    @Getter @Setter private int latency;
+    @Getter @Setter private boolean status;
+    @Getter @Setter private int responseCode;
+    @Getter @Setter private SpanLayer type;
+}
diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/receiver/EndpointRelation.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/receiver/EndpointRelation.java
new file mode 100644
index 000000000..53380b0fe
--- /dev/null
+++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/receiver/EndpointRelation.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.core.receiver;
+
+import lombok.*;
+import org.apache.skywalking.apm.network.language.agent.*;
+
+/**
+ * @author peng-yongsheng
+ */
+public class EndpointRelation extends Source {
+
+    @Override public Scope scope() {
+        return Scope.EndpointRelation;
+    }
+
+    @Getter @Setter private int endpointId;
+    @Getter @Setter private String endpoint;
+    @Getter @Setter private int childEndpointId;
+    @Getter @Setter private String childEndpoint;
+    @Getter @Setter private int rpcLatency;
+    @Getter @Setter private boolean status;
+    @Getter @Setter private int responseCode;
+    @Getter @Setter private SpanLayer type;
+    @Getter @Setter private SpanType detectPoint;
+}
+
diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/receiver/Scope.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/receiver/Scope.java
new file mode 100644
index 000000000..7ff4a3bc7
--- /dev/null
+++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/receiver/Scope.java
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.core.receiver;
+
+/**
+ * @author peng-yongsheng
+ */
+public enum Scope {
+    All, Service, ServiceInstance, Endpoint, ServiceRelation, ServiceInstanceRelation, EndpointRelation
+}
diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/receiver/Source.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/receiver/Source.java
new file mode 100644
index 000000000..2a59f392f
--- /dev/null
+++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/receiver/Source.java
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.core.receiver;
+
+import lombok.*;
+
+/**
+ * @author peng-yongsheng
+ */
+public abstract class Source {
+    public abstract Scope scope();
+
+    @Getter @Setter private long timeBucket;
+}
diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/receiver/SourceReceiver.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/receiver/SourceReceiver.java
new file mode 100644
index 000000000..99a4e1e49
--- /dev/null
+++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/receiver/SourceReceiver.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.core.receiver;
+
+import org.apache.skywalking.oap.server.library.module.Service;
+
+/**
+ * @author peng-yongsheng
+ */
+public interface SourceReceiver extends Service {
+    void receive(Source source);
+}
diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/receiver/SourceReceiverImpl.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/receiver/SourceReceiverImpl.java
new file mode 100644
index 000000000..4d04a31dd
--- /dev/null
+++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/receiver/SourceReceiverImpl.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.core.receiver;
+
+import org.apache.skywalking.oap.server.core.analysis.DispatcherManager;
+
+/**
+ * @author peng-yongsheng
+ */
+public class SourceReceiverImpl implements SourceReceiver {
+
+    private final DispatcherManager dispatcherManager;
+
+    public SourceReceiverImpl() {
+        this.dispatcherManager = new DispatcherManager();
+    }
+
+    @Override public void receive(Source source) {
+        dispatcherManager.getDispatcher(source.scope()).dispatch(source);
+    }
+}
diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/remote/Selector.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/remote/Selector.java
new file mode 100644
index 000000000..b7ac6ed00
--- /dev/null
+++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/remote/Selector.java
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.core.remote;
+
+/**
+ * @author peng-yongsheng
+ */
+public enum Selector {
+    HashCode, Rolling, ForeverFirst
+}
diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/server/GRPCHandlerRegister.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/server/GRPCHandlerRegister.java
new file mode 100644
index 000000000..3244d4415
--- /dev/null
+++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/server/GRPCHandlerRegister.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.core.server;
+
+import io.grpc.*;
+import org.apache.skywalking.oap.server.library.module.Service;
+
+/**
+ * @author peng-yongsheng
+ */
+public interface GRPCHandlerRegister extends Service {
+
+    void addHandler(BindableService handler);
+
+    void addHandler(ServerServiceDefinition definition);
+}
diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/server/GRPCHandlerRegisterImpl.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/server/GRPCHandlerRegisterImpl.java
new file mode 100644
index 000000000..229c3ca2b
--- /dev/null
+++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/server/GRPCHandlerRegisterImpl.java
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.core.server;
+
+import io.grpc.*;
+import org.apache.skywalking.oap.server.library.server.grpc.GRPCServer;
+
+/**
+ * @author peng-yongsheng
+ */
+public class GRPCHandlerRegisterImpl implements GRPCHandlerRegister {
+
+    private final GRPCServer server;
+
+    public GRPCHandlerRegisterImpl(GRPCServer server) {
+        this.server = server;
+    }
+
+    @Override public void addHandler(BindableService handler) {
+        server.addHandler(handler);
+    }
+
+    @Override public void addHandler(ServerServiceDefinition definition) {
+        server.addHandler(definition);
+    }
+}
diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/server/JettyHandlerRegister.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/server/JettyHandlerRegister.java
new file mode 100644
index 000000000..ef32bd15f
--- /dev/null
+++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/server/JettyHandlerRegister.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.core.server;
+
+import org.apache.skywalking.oap.server.library.module.Service;
+import org.apache.skywalking.oap.server.library.server.jetty.JettyHandler;
+
+/**
+ * @author peng-yongsheng
+ */
+public interface JettyHandlerRegister extends Service {
+    void addHandler(JettyHandler serverHandler);
+}
diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/server/JettyHandlerRegisterImpl.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/server/JettyHandlerRegisterImpl.java
new file mode 100644
index 000000000..3a4c2d850
--- /dev/null
+++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/server/JettyHandlerRegisterImpl.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.core.server;
+
+import org.apache.skywalking.oap.server.library.server.jetty.*;
+
+/**
+ * @author peng-yongsheng
+ */
+public class JettyHandlerRegisterImpl implements JettyHandlerRegister {
+
+    private final JettyServer server;
+
+    public JettyHandlerRegisterImpl(JettyServer server) {
+        this.server = server;
+    }
+
+    @Override public void addHandler(JettyHandler serverHandler) {
+        server.addHandler(serverHandler);
+    }
+}
diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/StorageModule.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/StorageModule.java
new file mode 100644
index 000000000..ccd7db01b
--- /dev/null
+++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/StorageModule.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.core.storage;
+
+import org.apache.skywalking.oap.server.library.module.ModuleDefine;
+
+/**
+ * @author peng-yongsheng
+ */
+public class StorageModule extends ModuleDefine {
+
+    public static final String NAME = "storage";
+
+    @Override public String name() {
+        return NAME;
+    }
+
+    @Override public Class[] services() {
+        return new Class[] {};
+    }
+}
diff --git a/oap-server/server-core/core-cluster/src/main/resources/META-INF/services/org.apache.skywalking.oap.server.library.module.ModuleDefine b/oap-server/server-core/src/main/resources/META-INF/services/org.apache.skywalking.oap.server.library.module.ModuleProvider
similarity index 93%
rename from oap-server/server-core/core-cluster/src/main/resources/META-INF/services/org.apache.skywalking.oap.server.library.module.ModuleDefine
rename to oap-server/server-core/src/main/resources/META-INF/services/org.apache.skywalking.oap.server.library.module.ModuleProvider
index 0810065b7..4025a1b2a 100644
--- a/oap-server/server-core/core-cluster/src/main/resources/META-INF/services/org.apache.skywalking.oap.server.library.module.ModuleDefine
+++ b/oap-server/server-core/src/main/resources/META-INF/services/org.apache.skywalking.oap.server.library.module.ModuleProvider
@@ -16,4 +16,4 @@
 #
 #
 
-org.apache.skywalking.oap.server.core.cluster.ClusterModule
\ No newline at end of file
+org.apache.skywalking.oap.server.core.CoreModuleProvider
\ No newline at end of file
diff --git a/oap-server/server-library/library-client/pom.xml b/oap-server/server-library/library-client/pom.xml
new file mode 100644
index 000000000..7ceece8d2
--- /dev/null
+++ b/oap-server/server-library/library-client/pom.xml
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements.  See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You 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.
+  ~
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>server-library</artifactId>
+        <groupId>org.apache.skywalking</groupId>
+        <version>6.0.0-alpha-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>library-client</artifactId>
+    <packaging>jar</packaging>
+
+    <dependencies>
+        <dependency>
+            <groupId>io.grpc</groupId>
+            <artifactId>grpc-core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.h2database</groupId>
+            <artifactId>h2</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>io.shardingjdbc</groupId>
+            <artifactId>sharding-jdbc-core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-dbcp</groupId>
+            <artifactId>commons-dbcp</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.elasticsearch.client</groupId>
+            <artifactId>elasticsearch-rest-client</artifactId>
+        </dependency>
+    </dependencies>
+</project>
\ No newline at end of file
diff --git a/oap-server/server-library/library-client/src/main/java/org/apache/skywalking/oap/server/library/client/Client.java b/oap-server/server-library/library-client/src/main/java/org/apache/skywalking/oap/server/library/client/Client.java
new file mode 100644
index 000000000..5e43021e2
--- /dev/null
+++ b/oap-server/server-library/library-client/src/main/java/org/apache/skywalking/oap/server/library/client/Client.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.library.client;
+
+/**
+ * @author peng-yongsheng
+ */
+public interface Client {
+    void initialize() throws ClientException;
+
+    void shutdown();
+}
diff --git a/oap-server/server-library/library-client/src/main/java/org/apache/skywalking/oap/server/library/client/ClientException.java b/oap-server/server-library/library-client/src/main/java/org/apache/skywalking/oap/server/library/client/ClientException.java
new file mode 100644
index 000000000..bd0c3a6a8
--- /dev/null
+++ b/oap-server/server-library/library-client/src/main/java/org/apache/skywalking/oap/server/library/client/ClientException.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.library.client;
+
+/**
+ * @author peng-yongsheng
+ */
+public abstract class ClientException extends Exception {
+    public ClientException(String message) {
+        super(message);
+    }
+
+    public ClientException(String message, Throwable cause) {
+        super(message, cause);
+    }
+}
diff --git a/oap-server/server-library/library-client/src/main/java/org/apache/skywalking/oap/server/library/client/NameSpace.java b/oap-server/server-library/library-client/src/main/java/org/apache/skywalking/oap/server/library/client/NameSpace.java
new file mode 100644
index 000000000..8983cecad
--- /dev/null
+++ b/oap-server/server-library/library-client/src/main/java/org/apache/skywalking/oap/server/library/client/NameSpace.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.library.client;
+
+/**
+ * @author peng-yongsheng
+ */
+public class NameSpace {
+
+    private String nameSpace = "";
+
+    public String getNameSpace() {
+        return nameSpace;
+    }
+
+    public void setNameSpace(String nameSpace) {
+        this.nameSpace = nameSpace;
+    }
+}
diff --git a/oap-server/server-library/library-client/src/main/java/org/apache/skywalking/oap/server/library/client/grpc/GRPCClient.java b/oap-server/server-library/library-client/src/main/java/org/apache/skywalking/oap/server/library/client/grpc/GRPCClient.java
new file mode 100644
index 000000000..2416be639
--- /dev/null
+++ b/oap-server/server-library/library-client/src/main/java/org/apache/skywalking/oap/server/library/client/grpc/GRPCClient.java
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.library.client.grpc;
+
+import io.grpc.*;
+import org.apache.skywalking.oap.server.library.client.Client;
+
+/**
+ * @author peng-yongsheng
+ */
+public class GRPCClient implements Client {
+
+    private final String host;
+
+    private final int port;
+
+    private ManagedChannel channel;
+
+    public GRPCClient(String host, int port) {
+        this.host = host;
+        this.port = port;
+    }
+
+    @Override public void initialize() {
+        channel = ManagedChannelBuilder.forAddress(host, port).usePlaintext(true).build();
+    }
+
+    @Override public void shutdown() {
+        channel.shutdownNow();
+    }
+
+    public ManagedChannel getChannel() {
+        return channel;
+    }
+
+    @Override public String toString() {
+        return host + ":" + port;
+    }
+}
diff --git a/oap-server/server-library/library-client/src/main/java/org/apache/skywalking/oap/server/library/client/grpc/GRPCClientConfig.java b/oap-server/server-library/library-client/src/main/java/org/apache/skywalking/oap/server/library/client/grpc/GRPCClientConfig.java
new file mode 100644
index 000000000..887342b26
--- /dev/null
+++ b/oap-server/server-library/library-client/src/main/java/org/apache/skywalking/oap/server/library/client/grpc/GRPCClientConfig.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.library.client.grpc;
+
+/**
+ * @author peng-yongsheng
+ */
+public abstract class GRPCClientConfig {
+
+    private String host;
+    private int port;
+
+    public String getHost() {
+        return host;
+    }
+
+    public void setHost(String host) {
+        this.host = host;
+    }
+
+    public int getPort() {
+        return port;
+    }
+
+    public void setPort(int port) {
+        this.port = port;
+    }
+}
diff --git a/oap-server/server-library/library-client/src/main/java/org/apache/skywalking/oap/server/library/client/grpc/GRPCClientException.java b/oap-server/server-library/library-client/src/main/java/org/apache/skywalking/oap/server/library/client/grpc/GRPCClientException.java
new file mode 100644
index 000000000..e5cbab661
--- /dev/null
+++ b/oap-server/server-library/library-client/src/main/java/org/apache/skywalking/oap/server/library/client/grpc/GRPCClientException.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.library.client.grpc;
+
+import org.apache.skywalking.oap.server.library.client.ClientException;
+
+/**
+ * @author peng-yongsheng
+ */
+public class GRPCClientException extends ClientException {
+
+    public GRPCClientException(String message) {
+        super(message);
+    }
+
+    public GRPCClientException(String message, Throwable cause) {
+        super(message, cause);
+    }
+}
diff --git a/oap-server/server-library/library-client/src/main/java/org/apache/skywalking/oap/server/library/client/h2/H2Client.java b/oap-server/server-library/library-client/src/main/java/org/apache/skywalking/oap/server/library/client/h2/H2Client.java
new file mode 100644
index 000000000..41a24eda7
--- /dev/null
+++ b/oap-server/server-library/library-client/src/main/java/org/apache/skywalking/oap/server/library/client/h2/H2Client.java
@@ -0,0 +1,113 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.library.client.h2;
+
+import java.sql.*;
+import org.apache.skywalking.oap.server.library.client.Client;
+import org.h2.util.IOUtils;
+import org.slf4j.*;
+
+/**
+ * @author peng-yongsheng
+ */
+public class H2Client implements Client {
+
+    private final Logger logger = LoggerFactory.getLogger(H2Client.class);
+
+    private Connection conn;
+    private String url;
+    private String userName;
+    private String password;
+
+    public H2Client() {
+        this.url = "jdbc:h2:mem:collector";
+        this.userName = "";
+        this.password = "";
+    }
+
+    public H2Client(String url, String userName, String password) {
+        this.url = url;
+        this.userName = userName;
+        this.password = password;
+    }
+
+    @Override public void initialize() throws H2ClientException {
+        try {
+            Class.forName("org.h2.Driver");
+            conn = DriverManager.
+                getConnection(this.url, this.userName, this.password);
+        } catch (Exception e) {
+            throw new H2ClientException(e.getMessage(), e);
+        }
+    }
+
+    @Override public void shutdown() {
+        IOUtils.closeSilently(conn);
+    }
+
+    public Connection getConnection() {
+        return conn;
+    }
+
+    public void execute(String sql) throws H2ClientException {
+        try (Statement statement = getConnection().createStatement()) {
+            statement.execute(sql);
+            statement.closeOnCompletion();
+        } catch (SQLException e) {
+            throw new H2ClientException(e.getMessage(), e);
+        }
+    }
+
+    public ResultSet executeQuery(String sql, Object[] params) throws H2ClientException {
+        logger.debug("execute query with result: {}", sql);
+        ResultSet rs;
+        PreparedStatement statement;
+        try {
+            statement = getConnection().prepareStatement(sql);
+            if (params != null) {
+                for (int i = 0; i < params.length; i++) {
+                    statement.setObject(i + 1, params[i]);
+                }
+            }
+            rs = statement.executeQuery();
+            statement.closeOnCompletion();
+        } catch (SQLException e) {
+            throw new H2ClientException(e.getMessage(), e);
+        }
+        return rs;
+    }
+
+    public boolean execute(String sql, Object[] params) throws H2ClientException {
+        logger.debug("execute insert/update/delete: {}", sql);
+        boolean flag;
+        Connection conn = getConnection();
+        try (PreparedStatement statement = conn.prepareStatement(sql)) {
+            conn.setAutoCommit(true);
+            if (params != null) {
+                for (int i = 0; i < params.length; i++) {
+                    statement.setObject(i + 1, params[i]);
+                }
+            }
+            flag = statement.execute();
+        } catch (SQLException e) {
+            throw new H2ClientException(e.getMessage(), e);
+        }
+        return flag;
+    }
+}
diff --git a/oap-server/server-library/library-client/src/main/java/org/apache/skywalking/oap/server/library/client/h2/H2ClientConfig.java b/oap-server/server-library/library-client/src/main/java/org/apache/skywalking/oap/server/library/client/h2/H2ClientConfig.java
new file mode 100644
index 000000000..764d906d2
--- /dev/null
+++ b/oap-server/server-library/library-client/src/main/java/org/apache/skywalking/oap/server/library/client/h2/H2ClientConfig.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.library.client.h2;
+
+/**
+ * @author peng-yongsheng
+ */
+public abstract class H2ClientConfig {
+
+    private String url;
+    private String userName;
+    private String password;
+
+    public String getUrl() {
+        return url;
+    }
+
+    public void setUrl(String url) {
+        this.url = url;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+}
diff --git a/oap-server/server-library/library-client/src/main/java/org/apache/skywalking/oap/server/library/client/h2/H2ClientException.java b/oap-server/server-library/library-client/src/main/java/org/apache/skywalking/oap/server/library/client/h2/H2ClientException.java
new file mode 100644
index 000000000..4c2d8c7b1
--- /dev/null
+++ b/oap-server/server-library/library-client/src/main/java/org/apache/skywalking/oap/server/library/client/h2/H2ClientException.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.library.client.h2;
+
+import org.apache.skywalking.oap.server.library.client.ClientException;
+
+/**
+ * @author peng-yongsheng
+ */
+public class H2ClientException extends ClientException {
+
+    public H2ClientException(String message) {
+        super(message);
+    }
+
+    public H2ClientException(String message, Throwable cause) {
+        super(message, cause);
+    }
+}
diff --git a/oap-server/server-library/library-client/src/main/java/org/apache/skywalking/oap/server/library/client/shardingjdbc/ShardingjdbcClient.java b/oap-server/server-library/library-client/src/main/java/org/apache/skywalking/oap/server/library/client/shardingjdbc/ShardingjdbcClient.java
new file mode 100644
index 000000000..3fb755900
--- /dev/null
+++ b/oap-server/server-library/library-client/src/main/java/org/apache/skywalking/oap/server/library/client/shardingjdbc/ShardingjdbcClient.java
@@ -0,0 +1,150 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.library.client.shardingjdbc;
+
+import io.shardingjdbc.core.api.ShardingDataSourceFactory;
+import io.shardingjdbc.core.api.config.ShardingRuleConfiguration;
+import java.sql.*;
+import java.util.*;
+import javax.sql.DataSource;
+import org.apache.commons.dbcp.BasicDataSource;
+import org.apache.skywalking.oap.server.library.client.Client;
+import org.slf4j.*;
+
+/**
+ * @author linjiaqi
+ */
+public class ShardingjdbcClient implements Client {
+
+    private static final Logger logger = LoggerFactory.getLogger(ShardingjdbcClient.class);
+
+    private Map<String, ShardingjdbcClientConfig> shardingjdbcClientConfig;
+
+    private ShardingRuleConfiguration shardingRuleConfiguration;
+
+    private Map<String, DataSource> shardingDataSource = new HashMap<String, DataSource>();
+
+    private DataSource dataSource;
+
+    public ShardingjdbcClient(Map<String, ShardingjdbcClientConfig> shardingjdbcClientConfig,
+        ShardingRuleConfiguration shardingRuleConfiguration) {
+        this.shardingjdbcClientConfig = shardingjdbcClientConfig;
+        this.shardingRuleConfiguration = shardingRuleConfiguration;
+    }
+
+    @Override public void initialize() throws ShardingjdbcClientException {
+        try {
+            shardingjdbcClientConfig.forEach((key, value) -> {
+                BasicDataSource basicDataSource = new BasicDataSource();
+                basicDataSource.setDriverClassName(value.getDriverClass());
+                basicDataSource.setUrl(value.getUrl());
+                basicDataSource.setUsername(value.getUserName());
+                basicDataSource.setPassword(value.getPassword());
+                shardingDataSource.put(key, basicDataSource);
+                logger.info("add sharding datasource: {}, url: {}", key, value.getUrl());
+            });
+            dataSource = ShardingDataSourceFactory.createDataSource(shardingDataSource, shardingRuleConfiguration,
+                new HashMap<String, Object>(), new Properties());
+        } catch (Exception e) {
+            logger.error("case the exception is 'Cannot load JDBC driver class', please add the driver mysql-connector-java-5.1.36.jar to collector-libs manual");
+            throw new ShardingjdbcClientException(e.getMessage(), e);
+        }
+    }
+
+    @Override public void shutdown() {
+
+    }
+
+    public Connection getConnection() throws SQLException {
+        return dataSource.getConnection();
+    }
+
+    public void execute(String sql) throws ShardingjdbcClientException {
+        Connection conn = null;
+        Statement statement = null;
+        try {
+            conn = getConnection();
+            statement = conn.createStatement();
+            statement.execute(sql);
+        } catch (SQLException e) {
+            throw new ShardingjdbcClientException(e.getMessage(), e);
+        } finally {
+            try {
+                if (statement != null) {
+                    statement.close();
+                }
+                if (conn != null) {
+                    conn.close();
+                }
+            } catch (SQLException e) {
+                throw new ShardingjdbcClientException(e.getMessage(), e);
+            }
+        }
+    }
+
+    public ResultSet executeQuery(String sql, Object[] params) throws ShardingjdbcClientException {
+        logger.debug("execute query with result: {}", sql);
+        ResultSet rs;
+        PreparedStatement statement;
+        try {
+            statement = getConnection().prepareStatement(sql);
+            if (params != null) {
+                for (int i = 0; i < params.length; i++) {
+                    statement.setObject(i + 1, params[i]);
+                }
+            }
+            rs = statement.executeQuery();
+        } catch (SQLException e) {
+            throw new ShardingjdbcClientException(e.getMessage(), e);
+        }
+        return rs;
+    }
+
+    public boolean execute(String sql, Object[] params) throws ShardingjdbcClientException {
+        logger.debug("execute insert/update/delete: {}", sql);
+        boolean flag;
+        Connection conn = null;
+        PreparedStatement statement = null;
+        try {
+            conn = getConnection();
+            conn.setAutoCommit(true);
+            statement = conn.prepareStatement(sql);
+            if (params != null) {
+                for (int i = 0; i < params.length; i++) {
+                    statement.setObject(i + 1, params[i]);
+                }
+            }
+            flag = statement.execute();
+        } catch (SQLException e) {
+            throw new ShardingjdbcClientException(e.getMessage(), e);
+        } finally {
+            try {
+                if (statement != null) {
+                    statement.close();
+                }
+                if (conn != null) {
+                    conn.close();
+                }
+            } catch (SQLException e) {
+                throw new ShardingjdbcClientException(e.getMessage(), e);
+            }
+        }
+        return flag;
+    }
+}
diff --git a/oap-server/server-library/library-client/src/main/java/org/apache/skywalking/oap/server/library/client/shardingjdbc/ShardingjdbcClientConfig.java b/oap-server/server-library/library-client/src/main/java/org/apache/skywalking/oap/server/library/client/shardingjdbc/ShardingjdbcClientConfig.java
new file mode 100644
index 000000000..08edb35e4
--- /dev/null
+++ b/oap-server/server-library/library-client/src/main/java/org/apache/skywalking/oap/server/library/client/shardingjdbc/ShardingjdbcClientConfig.java
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.library.client.shardingjdbc;
+
+/**
+ * @author linjiaqi
+ */
+public class ShardingjdbcClientConfig {
+
+    private String driverClass;
+    private String url;
+    private String userName;
+    private String password;
+
+    public ShardingjdbcClientConfig() {
+
+    }
+
+    public ShardingjdbcClientConfig(String driverClass, String url, String username, String password) {
+        this.driverClass = driverClass;
+        this.url = url;
+        this.userName = username;
+        this.password = password;
+    }
+
+    public String getDriverClass() {
+        return driverClass;
+    }
+
+    public void setDriverClass(String driverClass) {
+        this.driverClass = driverClass;
+    }
+
+    public String getUrl() {
+        return url;
+    }
+
+    public void setUrl(String url) {
+        this.url = url;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+}
diff --git a/oap-server/server-library/library-client/src/main/java/org/apache/skywalking/oap/server/library/client/shardingjdbc/ShardingjdbcClientException.java b/oap-server/server-library/library-client/src/main/java/org/apache/skywalking/oap/server/library/client/shardingjdbc/ShardingjdbcClientException.java
new file mode 100644
index 000000000..e8ee50a19
--- /dev/null
+++ b/oap-server/server-library/library-client/src/main/java/org/apache/skywalking/oap/server/library/client/shardingjdbc/ShardingjdbcClientException.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.library.client.shardingjdbc;
+
+import org.apache.skywalking.oap.server.library.client.ClientException;
+
+/**
+ * @author linjiaqi
+ */
+public class ShardingjdbcClientException extends ClientException {
+
+    public ShardingjdbcClientException(String message) {
+        super(message);
+    }
+
+    public ShardingjdbcClientException(String message, Throwable cause) {
+        super(message, cause);
+    }
+}
diff --git a/oap-server/server-library/library-module/src/main/java/org/apache/skywalking/oap/server/library/module/ModuleDefine.java b/oap-server/server-library/library-module/src/main/java/org/apache/skywalking/oap/server/library/module/ModuleDefine.java
index 7772102d0..04e5da702 100644
--- a/oap-server/server-library/library-module/src/main/java/org/apache/skywalking/oap/server/library/module/ModuleDefine.java
+++ b/oap-server/server-library/library-module/src/main/java/org/apache/skywalking/oap/server/library/module/ModuleDefine.java
@@ -50,7 +50,7 @@
      * @param configuration of this module
      * @throws ProviderNotFoundException when even don't find a single one providers.
      */
-    void prepare(ModuleManager moduleManager,
+    public void prepare(ModuleManager moduleManager,
         ApplicationConfiguration.ModuleConfiguration configuration) throws ProviderNotFoundException, ServiceNotProvidedException, ModuleConfigException {
         ServiceLoader<ModuleProvider> moduleProviderLoader = ServiceLoader.load(ModuleProvider.class);
         if (configuration.providerList().length != 1) {
@@ -119,7 +119,7 @@ private Field getDeclaredField(Class<?> destClass, String fieldName) throws NoSu
         throw new NoSuchFieldException();
     }
 
-    final ModuleProvider provider() {
+    public final ModuleProvider provider() {
         return moduleProvider;
     }
 
diff --git a/oap-server/server-library/library-module/src/main/java/org/apache/skywalking/oap/server/library/module/ModuleManager.java b/oap-server/server-library/library-module/src/main/java/org/apache/skywalking/oap/server/library/module/ModuleManager.java
index 00d1f4455..6e9aba96e 100644
--- a/oap-server/server-library/library-module/src/main/java/org/apache/skywalking/oap/server/library/module/ModuleManager.java
+++ b/oap-server/server-library/library-module/src/main/java/org/apache/skywalking/oap/server/library/module/ModuleManager.java
@@ -18,69 +18,15 @@
 
 package org.apache.skywalking.oap.server.library.module;
 
-import java.util.*;
-
 /**
- * The <code>ModuleManager</code> takes charge of all {@link ModuleDefine}s in collector.
- *
- * @author wu-sheng, peng-yongsheng
+ * @author peng-yongsheng
  */
-public class ModuleManager {
-    private boolean isInPrepareStage = true;
-    private final Map<String, ModuleDefine> loadedModules = new HashMap<>();
-
-    /**
-     * Init the given modules
-     */
-    public void init(
-        ApplicationConfiguration applicationConfiguration) throws ModuleNotFoundException, ProviderNotFoundException, ServiceNotProvidedException, ModuleConfigException, DuplicateProviderException, ModuleStartException {
-        String[] moduleNames = applicationConfiguration.moduleList();
-        ServiceLoader<ModuleDefine> moduleServiceLoader = ServiceLoader.load(ModuleDefine.class);
-        List<String> moduleList = new LinkedList<>(Arrays.asList(moduleNames));
-        for (ModuleDefine module : moduleServiceLoader) {
-            for (String moduleName : moduleNames) {
-                if (moduleName.equals(module.name())) {
-                    ModuleDefine newInstance;
-                    try {
-                        newInstance = module.getClass().newInstance();
-                    } catch (InstantiationException | IllegalAccessException e) {
-                        throw new ModuleNotFoundException(e);
-                    }
-
-                    newInstance.prepare(this, applicationConfiguration.getModuleConfiguration(moduleName));
-                    loadedModules.put(moduleName, newInstance);
-                    moduleList.remove(moduleName);
-                }
-            }
-        }
-        // Finish prepare stage
-        isInPrepareStage = false;
-
-        if (moduleList.size() > 0) {
-            throw new ModuleNotFoundException(moduleList.toString() + " missing.");
-        }
-
-        for (ModuleDefine module : loadedModules.values()) {
-            module.provider().start();
-            module.provider().notifyAfterCompleted();
-        }
-    }
+public interface ModuleManager {
 
-    public boolean has(String moduleName) {
-        return loadedModules.get(moduleName) != null;
-    }
+    void init(
+        ModuleDefine moduleDefine) throws ServiceNotProvidedException, ModuleConfigException, ProviderNotFoundException;
 
-    public ModuleDefine find(String moduleName) throws ModuleNotFoundRuntimeException {
-        assertPreparedStage();
-        ModuleDefine module = loadedModules.get(moduleName);
-        if (module != null)
-            return module;
-        throw new ModuleNotFoundRuntimeException(moduleName + " missing.");
-    }
+    void start() throws ServiceNotProvidedException, ModuleConfigException, ProviderNotFoundException, ModuleStartException;
 
-    private void assertPreparedStage() {
-        if (isInPrepareStage) {
-            throw new AssertionError("Still in preparing stage.");
-        }
-    }
+    ModuleDefine find(String moduleName) throws ModuleNotFoundRuntimeException;
 }
diff --git a/oap-server/server-library/library-module/src/test/java/org/apache/skywalking/oap/server/library/module/ModuleManagerTestCase.java b/oap-server/server-library/library-module/src/test/java/org/apache/skywalking/oap/server/library/module/ModuleManagerTestCase.java
index 210d80728..45216fd4f 100644
--- a/oap-server/server-library/library-module/src/test/java/org/apache/skywalking/oap/server/library/module/ModuleManagerTestCase.java
+++ b/oap-server/server-library/library-module/src/test/java/org/apache/skywalking/oap/server/library/module/ModuleManagerTestCase.java
@@ -43,60 +43,60 @@ public void init() {
 
     @Test
     public void testHas() throws ModuleNotFoundException, ModuleConfigException, ServiceNotProvidedException, ProviderNotFoundException, ModuleStartException, DuplicateProviderException {
-        ModuleManager manager = new ModuleManager();
-        manager.init(configuration);
-
-        Assert.assertTrue(manager.has(TestModule.NAME));
-        Assert.assertTrue(manager.has(BaseModuleA.NAME));
-        Assert.assertTrue(manager.has(BaseModuleB.NAME));
-
-        Assert.assertFalse(manager.has("Undefined"));
+//        ModuleManager manager = new ModuleManager();
+//        manager.init(configuration);
+//
+//        Assert.assertTrue(manager.has(TestModule.NAME));
+//        Assert.assertTrue(manager.has(BaseModuleA.NAME));
+//        Assert.assertTrue(manager.has(BaseModuleB.NAME));
+//
+//        Assert.assertFalse(manager.has("Undefined"));
     }
 
     @Test
     public void testFind() throws ModuleNotFoundException, ModuleConfigException, ServiceNotProvidedException, ProviderNotFoundException, ModuleStartException, DuplicateProviderException {
-        ModuleManager manager = new ModuleManager();
-        manager.init(configuration);
-
-        try {
-            manager.find("Undefined");
-        } catch (ModuleNotFoundRuntimeException e) {
-            Assert.assertEquals("Undefined missing.", e.getMessage());
-        }
+//        ModuleManager manager = new ModuleManager();
+//        manager.init(configuration);
+//
+//        try {
+//            manager.find("Undefined");
+//        } catch (ModuleNotFoundRuntimeException e) {
+//            Assert.assertEquals("Undefined missing.", e.getMessage());
+//        }
     }
 
     @Test
     public void testInit() throws ServiceNotProvidedException, DuplicateProviderException, ModuleConfigException, ModuleNotFoundException, ProviderNotFoundException, ModuleStartException {
-        ModuleManager manager = new ModuleManager();
-        manager.init(configuration);
-        BaseModuleA.ServiceABusiness1 serviceABusiness1 = manager.find(BaseModuleA.NAME).provider().getService(BaseModuleA.ServiceABusiness1.class);
-        Assert.assertNotNull(serviceABusiness1);
-
-        ModuleAProvider.Config config = (ModuleAProvider.Config)manager.find(BaseModuleA.NAME).provider().createConfigBeanIfAbsent();
-        Assert.assertEquals("oap", config.getHost());
+//        ModuleManager manager = new ModuleManager();
+//        manager.init(configuration);
+//        BaseModuleA.ServiceABusiness1 serviceABusiness1 = manager.find(BaseModuleA.NAME).provider().getService(BaseModuleA.ServiceABusiness1.class);
+//        Assert.assertNotNull(serviceABusiness1);
+//
+//        ModuleAProvider.Config config = (ModuleAProvider.Config)manager.find(BaseModuleA.NAME).provider().createConfigBeanIfAbsent();
+//        Assert.assertEquals("oap", config.getHost());
     }
 
     @Test
     public void testAssertPreparedStage() {
-        ModuleManager manager = new ModuleManager();
-
-        try {
-            manager.find("Undefined");
-        } catch (AssertionError e) {
-            Assert.assertEquals("Still in preparing stage.", e.getMessage());
-        }
+//        ModuleManager manager = new ModuleManager();
+//
+//        try {
+//            manager.find("Undefined");
+//        } catch (AssertionError e) {
+//            Assert.assertEquals("Still in preparing stage.", e.getMessage());
+//        }
     }
 
     @Test
     public void testEmptyConfig() throws ModuleConfigException, ServiceNotProvidedException, ProviderNotFoundException, ModuleStartException, DuplicateProviderException {
-        configuration.addModule("Undefined").addProviderConfiguration("Undefined", new Properties());
-
-        ModuleManager manager = new ModuleManager();
-
-        try {
-            manager.init(configuration);
-        } catch (ModuleNotFoundException e) {
-            Assert.assertEquals("[Undefined] missing.", e.getMessage());
-        }
+//        configuration.addModule("Undefined").addProviderConfiguration("Undefined", new Properties());
+//
+//        ModuleManager manager = new ModuleManager();
+//
+//        try {
+//            manager.init(configuration);
+//        } catch (ModuleNotFoundException e) {
+//            Assert.assertEquals("[Undefined] missing.", e.getMessage());
+//        }
     }
 }
diff --git a/oap-server/server-library/library-server/pom.xml b/oap-server/server-library/library-server/pom.xml
new file mode 100644
index 000000000..da3e9d5c5
--- /dev/null
+++ b/oap-server/server-library/library-server/pom.xml
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements.  See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You 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.
+  ~
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>server-library</artifactId>
+        <groupId>org.apache.skywalking</groupId>
+        <version>6.0.0-alpha-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>library-server</artifactId>
+    <packaging>jar</packaging>
+
+    <dependencies>
+        <dependency>
+            <groupId>io.grpc</groupId>
+            <artifactId>grpc-netty</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>io.grpc</groupId>
+            <artifactId>grpc-protobuf</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>io.grpc</groupId>
+            <artifactId>grpc-stub</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>io.grpc</groupId>
+            <artifactId>grpc-testing</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.eclipse.jetty</groupId>
+            <artifactId>jetty-server</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.eclipse.jetty</groupId>
+            <artifactId>jetty-servlet</artifactId>
+        </dependency>
+    </dependencies>
+</project>
\ No newline at end of file
diff --git a/oap-server/server-library/library-server/src/main/java/org/apache/skywalking/oap/server/library/server/Server.java b/oap-server/server-library/library-server/src/main/java/org/apache/skywalking/oap/server/library/server/Server.java
new file mode 100644
index 000000000..765778a00
--- /dev/null
+++ b/oap-server/server-library/library-server/src/main/java/org/apache/skywalking/oap/server/library/server/Server.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.library.server;
+
+/**
+ * @author peng-yongsheng, wusheng
+ */
+public interface Server {
+
+    String hostPort();
+
+    String serverClassify();
+
+    void initialize();
+
+    void start() throws ServerException;
+
+    boolean isSSLOpen();
+
+    boolean isStatusEqual(Server target);
+}
diff --git a/oap-server/server-library/library-server/src/main/java/org/apache/skywalking/oap/server/library/server/ServerException.java b/oap-server/server-library/library-server/src/main/java/org/apache/skywalking/oap/server/library/server/ServerException.java
new file mode 100644
index 000000000..bc7dd9c48
--- /dev/null
+++ b/oap-server/server-library/library-server/src/main/java/org/apache/skywalking/oap/server/library/server/ServerException.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.library.server;
+
+/**
+ * @author peng-yongsheng
+ */
+public abstract class ServerException extends Exception {
+
+    public ServerException(String message) {
+        super(message);
+    }
+
+    public ServerException(String message, Throwable cause) {
+        super(message, cause);
+    }
+}
diff --git a/oap-server/server-library/library-server/src/main/java/org/apache/skywalking/oap/server/library/server/ServerHandler.java b/oap-server/server-library/library-server/src/main/java/org/apache/skywalking/oap/server/library/server/ServerHandler.java
new file mode 100644
index 000000000..f582b06aa
--- /dev/null
+++ b/oap-server/server-library/library-server/src/main/java/org/apache/skywalking/oap/server/library/server/ServerHandler.java
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.library.server;
+
+/**
+ * @author peng-yongsheng
+ */
+public interface ServerHandler {
+}
diff --git a/oap-server/server-library/library-server/src/main/java/org/apache/skywalking/oap/server/library/server/grpc/GRPCHandler.java b/oap-server/server-library/library-server/src/main/java/org/apache/skywalking/oap/server/library/server/grpc/GRPCHandler.java
new file mode 100644
index 000000000..01903bb42
--- /dev/null
+++ b/oap-server/server-library/library-server/src/main/java/org/apache/skywalking/oap/server/library/server/grpc/GRPCHandler.java
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.library.server.grpc;
+
+import org.apache.skywalking.oap.server.library.server.ServerHandler;
+
+/**
+ * @author peng-yongsheng
+ */
+public interface GRPCHandler extends ServerHandler {
+}
diff --git a/oap-server/server-library/library-server/src/main/java/org/apache/skywalking/oap/server/library/server/grpc/GRPCServer.java b/oap-server/server-library/library-server/src/main/java/org/apache/skywalking/oap/server/library/server/grpc/GRPCServer.java
new file mode 100644
index 000000000..0bd15e600
--- /dev/null
+++ b/oap-server/server-library/library-server/src/main/java/org/apache/skywalking/oap/server/library/server/grpc/GRPCServer.java
@@ -0,0 +1,125 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.library.server.grpc;
+
+import io.grpc.*;
+import io.grpc.netty.*;
+import io.netty.handler.ssl.*;
+import java.io.*;
+import java.net.InetSocketAddress;
+import java.util.Objects;
+import org.apache.skywalking.oap.server.library.server.Server;
+import org.apache.skywalking.oap.server.library.server.*;
+import org.slf4j.*;
+
+/**
+ * @author peng-yongsheng, wusheng
+ */
+public class GRPCServer implements Server {
+
+    private static final Logger logger = LoggerFactory.getLogger(GRPCServer.class);
+
+    private final String host;
+    private final int port;
+    private io.grpc.Server server;
+    private NettyServerBuilder nettyServerBuilder;
+    private SslContextBuilder sslContextBuilder;
+    private File certChainFile;
+    private File privateKeyFile;
+
+    public GRPCServer(String host, int port) {
+        this.host = host;
+        this.port = port;
+    }
+
+    /**
+     * Require for `server.crt` and `server.pem` for open ssl at server side.
+     *
+     * @param host
+     * @param port
+     * @param certChainFile `server.crt` file
+     * @param privateKeyFile `server.pem` file
+     */
+    public GRPCServer(String host, int port, File certChainFile, File privateKeyFile) {
+        this.host = host;
+        this.port = port;
+        this.certChainFile = certChainFile;
+        this.privateKeyFile = privateKeyFile;
+        this.sslContextBuilder = SslContextBuilder.forServer(certChainFile,
+            privateKeyFile);
+    }
+
+    @Override
+    public String hostPort() {
+        return host + ":" + port;
+    }
+
+    @Override
+    public String serverClassify() {
+        return "Google-RPC";
+    }
+
+    @Override
+    public void initialize() {
+        InetSocketAddress address = new InetSocketAddress(host, port);
+        nettyServerBuilder = NettyServerBuilder.forAddress(address);
+        logger.info("Server started, host {} listening on {}", host, port);
+    }
+
+    @Override
+    public void start() throws ServerException {
+        try {
+            if (sslContextBuilder != null) {
+                nettyServerBuilder = nettyServerBuilder.sslContext(
+                    GrpcSslContexts.configure(sslContextBuilder,
+                        SslProvider.OPENSSL).build());
+            }
+            server = nettyServerBuilder.build();
+            server.start();
+        } catch (IOException e) {
+            throw new GRPCServerException(e.getMessage(), e);
+        }
+    }
+
+    public void addHandler(BindableService handler) {
+        nettyServerBuilder.addService(handler);
+    }
+
+    public void addHandler(ServerServiceDefinition definition) {
+        nettyServerBuilder.addService(definition);
+    }
+
+    @Override
+    public boolean isSSLOpen() {
+        return sslContextBuilder == null;
+    }
+
+    @Override
+    public boolean isStatusEqual(Server target) {
+        if (this == target)
+            return true;
+        if (target == null || getClass() != target.getClass())
+            return false;
+        GRPCServer that = (GRPCServer)target;
+        return port == that.port &&
+            Objects.equals(host, that.host) &&
+            Objects.equals(certChainFile, that.certChainFile) &&
+            Objects.equals(privateKeyFile, that.privateKeyFile);
+    }
+}
diff --git a/oap-server/server-library/library-server/src/main/java/org/apache/skywalking/oap/server/library/server/grpc/GRPCServerConfig.java b/oap-server/server-library/library-server/src/main/java/org/apache/skywalking/oap/server/library/server/grpc/GRPCServerConfig.java
new file mode 100644
index 000000000..f0a5c2fac
--- /dev/null
+++ b/oap-server/server-library/library-server/src/main/java/org/apache/skywalking/oap/server/library/server/grpc/GRPCServerConfig.java
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.library.server.grpc;
+
+/**
+ * @author peng-yongsheng
+ */
+public abstract class GRPCServerConfig {
+
+    private String host;
+    private int port;
+    private String sslCertChainFilePath;
+    private String sslPrivateKeyFilePath;
+    private String authentication;
+
+    public String getHost() {
+        return host;
+    }
+
+    public void setHost(String host) {
+        this.host = host;
+    }
+
+    public int getPort() {
+        return port;
+    }
+
+    public void setPort(int port) {
+        this.port = port;
+    }
+
+    public String getSslCertChainFilePath() {
+        return sslCertChainFilePath;
+    }
+
+    public void setSslCertChainFilePath(String sslCertChainFilePath) {
+        this.sslCertChainFilePath = sslCertChainFilePath;
+    }
+
+    public String getSslPrivateKeyFilePath() {
+        return sslPrivateKeyFilePath;
+    }
+
+    public void setSslPrivateKeyFilePath(String sslPrivateKeyFilePath) {
+        this.sslPrivateKeyFilePath = sslPrivateKeyFilePath;
+    }
+
+    public String getAuthentication() {
+        return authentication;
+    }
+
+    public void setAuthentication(String authentication) {
+        this.authentication = authentication;
+    }
+}
diff --git a/oap-server/server-library/library-server/src/main/java/org/apache/skywalking/oap/server/library/server/grpc/GRPCServerException.java b/oap-server/server-library/library-server/src/main/java/org/apache/skywalking/oap/server/library/server/grpc/GRPCServerException.java
new file mode 100644
index 000000000..4ba69edb8
--- /dev/null
+++ b/oap-server/server-library/library-server/src/main/java/org/apache/skywalking/oap/server/library/server/grpc/GRPCServerException.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.library.server.grpc;
+
+import org.apache.skywalking.oap.server.library.server.ServerException;
+
+/**
+ * @author peng-yongsheng
+ */
+public class GRPCServerException extends ServerException {
+
+    public GRPCServerException(String message) {
+        super(message);
+    }
+
+    public GRPCServerException(String message, Throwable cause) {
+        super(message, cause);
+    }
+}
diff --git a/oap-server/server-library/library-server/src/main/java/org/apache/skywalking/oap/server/library/server/jetty/ArgumentsParseException.java b/oap-server/server-library/library-server/src/main/java/org/apache/skywalking/oap/server/library/server/jetty/ArgumentsParseException.java
new file mode 100644
index 000000000..e12cb6220
--- /dev/null
+++ b/oap-server/server-library/library-server/src/main/java/org/apache/skywalking/oap/server/library/server/jetty/ArgumentsParseException.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.library.server.jetty;
+
+/**
+ * @author peng-yongsheng
+ */
+public class ArgumentsParseException extends Exception {
+
+    public ArgumentsParseException(String message) {
+        super(message);
+    }
+
+    public ArgumentsParseException(String message, Throwable cause) {
+        super(message, cause);
+    }
+}
diff --git a/oap-server/server-library/library-server/src/main/java/org/apache/skywalking/oap/server/library/server/jetty/JettyHandler.java b/oap-server/server-library/library-server/src/main/java/org/apache/skywalking/oap/server/library/server/jetty/JettyHandler.java
new file mode 100644
index 000000000..e9ba86d57
--- /dev/null
+++ b/oap-server/server-library/library-server/src/main/java/org/apache/skywalking/oap/server/library/server/jetty/JettyHandler.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.library.server.jetty;
+
+import javax.servlet.http.HttpServlet;
+import org.apache.skywalking.oap.server.library.server.ServerHandler;
+
+/**
+ * @author peng-yongsheng
+ */
+public abstract class JettyHandler extends HttpServlet implements ServerHandler {
+    public abstract String pathSpec();
+}
diff --git a/oap-server/server-library/library-server/src/main/java/org/apache/skywalking/oap/server/library/server/jetty/JettyJsonHandler.java b/oap-server/server-library/library-server/src/main/java/org/apache/skywalking/oap/server/library/server/jetty/JettyJsonHandler.java
new file mode 100644
index 000000000..86c02fab3
--- /dev/null
+++ b/oap-server/server-library/library-server/src/main/java/org/apache/skywalking/oap/server/library/server/jetty/JettyJsonHandler.java
@@ -0,0 +1,175 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.library.server.jetty;
+
+import com.google.gson.JsonElement;
+import java.io.*;
+import java.util.Enumeration;
+import javax.servlet.*;
+import javax.servlet.http.*;
+import org.slf4j.*;
+
+import static java.util.Objects.nonNull;
+
+/**
+ * @author wusheng
+ */
+public abstract class JettyJsonHandler extends JettyHandler {
+    private static final Logger logger = LoggerFactory.getLogger(JettyHandler.class);
+
+    @Override
+    protected final void doGet(HttpServletRequest req, HttpServletResponse resp) {
+        try {
+            reply(resp, doGet(req));
+        } catch (ArgumentsParseException | IOException e) {
+            try {
+                replyError(resp, e.getMessage(), HttpServletResponse.SC_BAD_REQUEST);
+            } catch (IOException replyException) {
+                logger.error(replyException.getMessage(), e);
+            }
+        }
+    }
+
+    protected abstract JsonElement doGet(HttpServletRequest req) throws ArgumentsParseException;
+
+    @Override
+    protected final void doPost(HttpServletRequest req, HttpServletResponse resp) {
+        try {
+            reply(resp, doPost(req));
+        } catch (ArgumentsParseException | IOException e) {
+            try {
+                replyError(resp, e.getMessage(), HttpServletResponse.SC_BAD_REQUEST);
+            } catch (IOException replyException) {
+                logger.error(replyException.getMessage(), e);
+            }
+        }
+    }
+
+    protected abstract JsonElement doPost(HttpServletRequest req) throws ArgumentsParseException, IOException;
+
+    @Override
+    protected final void doHead(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
+        super.doHead(req, resp);
+    }
+
+    @Override protected final long getLastModified(HttpServletRequest req) {
+        return super.getLastModified(req);
+    }
+
+    @Override
+    protected final void doPut(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
+        super.doPut(req, resp);
+    }
+
+    @Override
+    protected final void doDelete(HttpServletRequest req,
+        HttpServletResponse resp) throws ServletException, IOException {
+        super.doDelete(req, resp);
+    }
+
+    @Override
+    protected final void doOptions(HttpServletRequest req,
+        HttpServletResponse resp) throws ServletException, IOException {
+        super.doOptions(req, resp);
+    }
+
+    @Override
+    protected final void doTrace(HttpServletRequest req,
+        HttpServletResponse resp) throws ServletException, IOException {
+        super.doTrace(req, resp);
+    }
+
+    @Override
+    protected final void service(HttpServletRequest req,
+        HttpServletResponse resp) throws ServletException, IOException {
+        super.service(req, resp);
+    }
+
+    @Override public final void service(ServletRequest req, ServletResponse res) throws ServletException, IOException {
+        super.service(req, res);
+    }
+
+    @Override public final void destroy() {
+        super.destroy();
+    }
+
+    @Override public final String getInitParameter(String name) {
+        return super.getInitParameter(name);
+    }
+
+    @Override public final Enumeration<String> getInitParameterNames() {
+        return super.getInitParameterNames();
+    }
+
+    @Override public final ServletConfig getServletConfig() {
+        return super.getServletConfig();
+    }
+
+    @Override public final ServletContext getServletContext() {
+        return super.getServletContext();
+    }
+
+    @Override public final String getServletInfo() {
+        return super.getServletInfo();
+    }
+
+    @Override public final void init(ServletConfig config) throws ServletException {
+        super.init(config);
+    }
+
+    @Override public final void init() throws ServletException {
+        super.init();
+    }
+
+    @Override public final void log(String msg) {
+        super.log(msg);
+    }
+
+    @Override public final void log(String message, Throwable t) {
+        super.log(message, t);
+    }
+
+    @Override public final String getServletName() {
+        return super.getServletName();
+    }
+
+    private void reply(HttpServletResponse response, JsonElement resJson) throws IOException {
+        response.setContentType("application/json");
+        response.setCharacterEncoding("utf-8");
+        response.setStatus(HttpServletResponse.SC_OK);
+
+        PrintWriter out = response.getWriter();
+        if (nonNull(resJson)) {
+            out.print(resJson);
+        }
+        out.flush();
+        out.close();
+    }
+
+    private void replyError(HttpServletResponse response, String errorMessage, int status) throws IOException {
+        response.setContentType("application/json");
+        response.setCharacterEncoding("utf-8");
+        response.setStatus(status);
+        response.setHeader("error-message", errorMessage);
+
+        PrintWriter out = response.getWriter();
+        out.flush();
+        out.close();
+    }
+}
diff --git a/oap-server/server-library/library-server/src/main/java/org/apache/skywalking/oap/server/library/server/jetty/JettyServer.java b/oap-server/server-library/library-server/src/main/java/org/apache/skywalking/oap/server/library/server/jetty/JettyServer.java
new file mode 100644
index 000000000..84e24d4c1
--- /dev/null
+++ b/oap-server/server-library/library-server/src/main/java/org/apache/skywalking/oap/server/library/server/jetty/JettyServer.java
@@ -0,0 +1,116 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.library.server.jetty;
+
+import java.net.InetSocketAddress;
+import java.util.Objects;
+import org.apache.skywalking.oap.server.library.server.*;
+import org.eclipse.jetty.servlet.*;
+import org.slf4j.*;
+
+/**
+ * @author peng-yongsheng, wusheng
+ */
+public class JettyServer implements Server {
+
+    private static final Logger logger = LoggerFactory.getLogger(JettyServer.class);
+
+    private final String host;
+    private final int port;
+    private final String contextPath;
+    private org.eclipse.jetty.server.Server server;
+    private ServletContextHandler servletContextHandler;
+
+    public JettyServer(String host, int port, String contextPath) {
+        this.host = host;
+        this.port = port;
+        this.contextPath = contextPath;
+    }
+
+    @Override
+    public String hostPort() {
+        return host + ":" + port;
+    }
+
+    @Override
+    public String serverClassify() {
+        return "Jetty";
+    }
+
+    @Override
+    public void initialize() {
+        server = new org.eclipse.jetty.server.Server(new InetSocketAddress(host, port));
+
+        servletContextHandler = new ServletContextHandler(ServletContextHandler.NO_SESSIONS);
+        servletContextHandler.setContextPath(contextPath);
+        logger.info("http server root context path: {}", contextPath);
+
+        server.setHandler(servletContextHandler);
+    }
+
+    public void addHandler(JettyHandler handler) {
+        ServletHolder servletHolder = new ServletHolder();
+        servletHolder.setServlet(handler);
+        servletContextHandler.addServlet(servletHolder, handler.pathSpec());
+    }
+
+    @Override
+    public boolean isSSLOpen() {
+        return false;
+    }
+
+    @Override
+    public boolean isStatusEqual(Server target) {
+        return equals(target);
+    }
+
+    @Override
+    public void start() throws ServerException {
+        logger.info("start server, host: {}, port: {}", host, port);
+        try {
+            if (logger.isDebugEnabled()) {
+                if (servletContextHandler.getServletHandler() != null && servletContextHandler.getServletHandler().getServletMappings() != null) {
+                    for (ServletMapping servletMapping : servletContextHandler.getServletHandler().getServletMappings()) {
+                        logger.debug("jetty servlet mappings: {} register by {}", servletMapping.getPathSpecs(), servletMapping.getServletName());
+                    }
+                }
+            }
+
+            server.start();
+        } catch (Exception e) {
+            throw new JettyServerException(e.getMessage(), e);
+        }
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o)
+            return true;
+        if (o == null || getClass() != o.getClass())
+            return false;
+        JettyServer that = (JettyServer)o;
+        return port == that.port &&
+            Objects.equals(host, that.host);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(host, port);
+    }
+}
diff --git a/oap-server/server-library/library-server/src/main/java/org/apache/skywalking/oap/server/library/server/jetty/JettyServerConfig.java b/oap-server/server-library/library-server/src/main/java/org/apache/skywalking/oap/server/library/server/jetty/JettyServerConfig.java
new file mode 100644
index 000000000..0902c02a5
--- /dev/null
+++ b/oap-server/server-library/library-server/src/main/java/org/apache/skywalking/oap/server/library/server/jetty/JettyServerConfig.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.library.server.jetty;
+
+/**
+ * @author peng-yongsheng
+ */
+public abstract class JettyServerConfig {
+
+    private String host;
+    private int port;
+    private String contextPath;
+
+    public String getHost() {
+        return host;
+    }
+
+    public void setHost(String host) {
+        this.host = host;
+    }
+
+    public int getPort() {
+        return port;
+    }
+
+    public void setPort(int port) {
+        this.port = port;
+    }
+
+    public String getContextPath() {
+        return contextPath;
+    }
+
+    public void setContextPath(String contextPath) {
+        this.contextPath = contextPath;
+    }
+}
diff --git a/oap-server/server-library/library-server/src/main/java/org/apache/skywalking/oap/server/library/server/jetty/JettyServerException.java b/oap-server/server-library/library-server/src/main/java/org/apache/skywalking/oap/server/library/server/jetty/JettyServerException.java
new file mode 100644
index 000000000..242ca23c6
--- /dev/null
+++ b/oap-server/server-library/library-server/src/main/java/org/apache/skywalking/oap/server/library/server/jetty/JettyServerException.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.library.server.jetty;
+
+import org.apache.skywalking.oap.server.library.server.ServerException;
+
+/**
+ * @author peng-yongsheng
+ */
+public class JettyServerException extends ServerException {
+
+    public JettyServerException(String message) {
+        super(message);
+    }
+
+    public JettyServerException(String message, Throwable cause) {
+        super(message, cause);
+    }
+}
diff --git a/oap-server/server-library/pom.xml b/oap-server/server-library/pom.xml
index 863ca992c..5df8a5a0f 100644
--- a/oap-server/server-library/pom.xml
+++ b/oap-server/server-library/pom.xml
@@ -31,7 +31,8 @@
     <packaging>pom</packaging>
     <modules>
         <module>library-module</module>
+        <module>library-server</module>
         <module>library-util</module>
+        <module>library-client</module>
     </modules>
-
 </project>
\ No newline at end of file
diff --git a/oap-server/server-receiver-plugin/pom.xml b/oap-server/server-receiver-plugin/pom.xml
new file mode 100644
index 000000000..9de85a49c
--- /dev/null
+++ b/oap-server/server-receiver-plugin/pom.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements.  See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You 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.
+  ~
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>oap-server</artifactId>
+        <groupId>org.apache.skywalking</groupId>
+        <version>6.0.0-alpha-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>server-receiver-plugin</artifactId>
+    <packaging>pom</packaging>
+    <modules>
+        <module>skywalking-receiver-plugin</module>
+        <module>zipkin-receiver-plugin</module>
+    </modules>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.skywalking</groupId>
+            <artifactId>library-module</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.skywalking</groupId>
+            <artifactId>library-util</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+</project>
\ No newline at end of file
diff --git a/oap-server/server-receiver-plugin/skywalking-receiver-plugin/pom.xml b/oap-server/server-receiver-plugin/skywalking-receiver-plugin/pom.xml
new file mode 100644
index 000000000..61066ca1d
--- /dev/null
+++ b/oap-server/server-receiver-plugin/skywalking-receiver-plugin/pom.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements.  See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You 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.
+  ~
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>server-receiver-plugin</artifactId>
+        <groupId>org.apache.skywalking</groupId>
+        <version>6.0.0-alpha-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>skywalking-receiver-plugin</artifactId>
+    <packaging>jar</packaging>
+</project>
\ No newline at end of file
diff --git a/oap-server/server-receiver-plugin/zipkin-receiver-plugin/pom.xml b/oap-server/server-receiver-plugin/zipkin-receiver-plugin/pom.xml
new file mode 100644
index 000000000..8dcf89a74
--- /dev/null
+++ b/oap-server/server-receiver-plugin/zipkin-receiver-plugin/pom.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements.  See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You 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.
+  ~
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>server-receiver-plugin</artifactId>
+        <groupId>org.apache.skywalking</groupId>
+        <version>6.0.0-alpha-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>zipkin-receiver-plugin</artifactId>
+    <packaging>jar</packaging>
+
+</project>
\ No newline at end of file
diff --git a/oap-server/server-starter/pom.xml b/oap-server/server-starter/pom.xml
index a0599ce3e..d3aacb3db 100644
--- a/oap-server/server-starter/pom.xml
+++ b/oap-server/server-starter/pom.xml
@@ -35,6 +35,12 @@
             <groupId>org.yaml</groupId>
             <artifactId>snakeyaml</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.apache.skywalking</groupId>
+            <artifactId>server-core</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <!-- cluster module -->
         <dependency>
             <groupId>org.apache.skywalking</groupId>
             <artifactId>cluster-standalone-plugin</artifactId>
@@ -45,10 +51,27 @@
             <artifactId>cluster-zookeeper-plugin</artifactId>
             <version>${project.version}</version>
         </dependency>
+        <!-- cluster module -->
+
+        <!-- receiver module -->
+        <dependency>
+            <groupId>org.apache.skywalking</groupId>
+            <artifactId>skywalking-receiver-plugin</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <!-- receiver module -->
+
+        <!-- storage module -->
+        <dependency>
+            <groupId>org.apache.skywalking</groupId>
+            <artifactId>storage-h2-plugin</artifactId>
+            <version>${project.version}</version>
+        </dependency>
         <dependency>
             <groupId>org.apache.skywalking</groupId>
-            <artifactId>library-util</artifactId>
+            <artifactId>storage-elasticsearch-plugin</artifactId>
             <version>${project.version}</version>
         </dependency>
+        <!-- storage module -->
     </dependencies>
 </project>
\ No newline at end of file
diff --git a/oap-server/server-starter/src/main/java/org/apache/skywalking/oap/server/starter/ModuleManagerImpl.java b/oap-server/server-starter/src/main/java/org/apache/skywalking/oap/server/starter/ModuleManagerImpl.java
new file mode 100644
index 000000000..1448e70e0
--- /dev/null
+++ b/oap-server/server-starter/src/main/java/org/apache/skywalking/oap/server/starter/ModuleManagerImpl.java
@@ -0,0 +1,75 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.starter;
+
+import java.util.*;
+import org.apache.skywalking.oap.server.core.CoreModule;
+import org.apache.skywalking.oap.server.core.cluster.ClusterModule;
+import org.apache.skywalking.oap.server.core.storage.StorageModule;
+import org.apache.skywalking.oap.server.library.module.*;
+
+/**
+ * @author peng-yongsheng
+ */
+public class ModuleManagerImpl implements ModuleManager {
+
+    private final ApplicationConfiguration applicationConfiguration;
+    private final Map<String, ModuleDefine> modules;
+
+    public ModuleManagerImpl(ApplicationConfiguration applicationConfiguration) {
+        this.applicationConfiguration = applicationConfiguration;
+        this.modules = new HashMap<>();
+    }
+
+    @Override
+    public void start() throws ServiceNotProvidedException, ModuleConfigException, ProviderNotFoundException, ModuleStartException {
+        CoreModule coreModule = new CoreModule();
+        ClusterModule clusterModule = new ClusterModule();
+        StorageModule storageModule = new StorageModule();
+
+        init(coreModule);
+        init(clusterModule);
+        init(storageModule);
+
+        coreModule.provider().start();
+        storageModule.provider().start();
+        clusterModule.provider().start();
+
+        coreModule.provider().notifyAfterCompleted();
+        storageModule.provider().notifyAfterCompleted();
+        clusterModule.provider().notifyAfterCompleted();
+    }
+
+    @Override public void init(
+        ModuleDefine moduleDefine) throws ServiceNotProvidedException, ModuleConfigException, ProviderNotFoundException {
+        if (!applicationConfiguration.has(moduleDefine.name())) {
+            throw new ModuleConfigException("Can't found core module configuration, please check the application.yml file.");
+        }
+
+        moduleDefine.prepare(this, applicationConfiguration.getModuleConfiguration(moduleDefine.name()));
+        modules.put(moduleDefine.name(), moduleDefine);
+    }
+
+    @Override public ModuleDefine find(String moduleName) throws ModuleNotFoundRuntimeException {
+        ModuleDefine module = modules.get(moduleName);
+        if (module != null)
+            return module;
+        throw new ModuleNotFoundRuntimeException(moduleName + " missing.");
+    }
+}
diff --git a/oap-server/server-starter/src/main/java/org/apache/skywalking/oap/server/starter/OAPBootStartUp.java b/oap-server/server-starter/src/main/java/org/apache/skywalking/oap/server/starter/OAPServerStartUp.java
similarity index 75%
rename from oap-server/server-starter/src/main/java/org/apache/skywalking/oap/server/starter/OAPBootStartUp.java
rename to oap-server/server-starter/src/main/java/org/apache/skywalking/oap/server/starter/OAPServerStartUp.java
index 0bcf6bacf..668aa5ede 100644
--- a/oap-server/server-starter/src/main/java/org/apache/skywalking/oap/server/starter/OAPBootStartUp.java
+++ b/oap-server/server-starter/src/main/java/org/apache/skywalking/oap/server/starter/OAPServerStartUp.java
@@ -19,28 +19,30 @@
 package org.apache.skywalking.oap.server.starter;
 
 import java.util.concurrent.TimeUnit;
-import org.apache.skywalking.oap.server.library.module.*;
-import org.apache.skywalking.oap.server.starter.config.*;
+import org.apache.skywalking.oap.server.library.module.ApplicationConfiguration;
+import org.apache.skywalking.oap.server.starter.config.ApplicationConfigLoader;
 import org.slf4j.*;
 
 /**
  * @author peng-yongsheng
  */
-public class OAPBootStartUp {
+public class OAPServerStartUp {
 
-    private static final Logger logger = LoggerFactory.getLogger(OAPBootStartUp.class);
+    private static final Logger logger = LoggerFactory.getLogger(OAPServerStartUp.class);
 
     public static void main(String[] args) {
         ApplicationConfigLoader configLoader = new ApplicationConfigLoader();
-        ModuleManager manager = new ModuleManager();
+
         try {
             ApplicationConfiguration applicationConfiguration = configLoader.load();
-            manager.init(applicationConfiguration);
-        } catch (ConfigFileNotFoundException | ModuleNotFoundException | ProviderNotFoundException | ServiceNotProvidedException | ModuleConfigException | ModuleStartException | DuplicateProviderException e) {
+            ModuleManagerImpl moduleManager = new ModuleManagerImpl(applicationConfiguration);
+            moduleManager.start();
+        } catch (Throwable e) {
             logger.error(e.getMessage(), e);
             System.exit(1);
         }
 
+        logger.info("OAP server start up successful.");
         try {
             TimeUnit.MINUTES.sleep(5);
         } catch (InterruptedException e) {
diff --git a/oap-server/server-starter/src/main/resources/application.yml b/oap-server/server-starter/src/main/resources/application.yml
index bfe498a4b..5bdaa05e2 100644
--- a/oap-server/server-starter/src/main/resources/application.yml
+++ b/oap-server/server-starter/src/main/resources/application.yml
@@ -25,4 +25,13 @@ cluster:
 #    #OS real network IP(binding required), for agent to find collector cluster
 #    host: localhost
 #    port: 10800
-#    contextPath: /
\ No newline at end of file
+#    contextPath: /
+core:
+  default:
+    restHost: localhost
+    restPort: 12800
+    restContextPath: /
+    gRPCHost: localhost
+    gRPCPort: 11800
+storage:
+  elasticsearch:
diff --git a/oap-server/server-storage-plugin/pom.xml b/oap-server/server-storage-plugin/pom.xml
new file mode 100644
index 000000000..ff237b04a
--- /dev/null
+++ b/oap-server/server-storage-plugin/pom.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements.  See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You 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.
+  ~
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>oap-server</artifactId>
+        <groupId>org.apache.skywalking</groupId>
+        <version>6.0.0-alpha-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>server-storage-plugin</artifactId>
+    <packaging>pom</packaging>
+    <modules>
+        <module>storage-h2-plugin</module>
+        <module>storage-elasticsearch-plugin</module>
+    </modules>
+
+</project>
\ No newline at end of file
diff --git a/oap-server/server-storage-plugin/storage-elasticsearch-plugin/pom.xml b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/pom.xml
new file mode 100644
index 000000000..e0adc4370
--- /dev/null
+++ b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/pom.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements.  See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You 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.
+  ~
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>server-storage-plugin</artifactId>
+        <groupId>org.apache.skywalking</groupId>
+        <version>6.0.0-alpha-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>storage-elasticsearch-plugin</artifactId>
+    <packaging>jar</packaging>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.skywalking</groupId>
+            <artifactId>server-core</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+</project>
\ No newline at end of file
diff --git a/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/StorageModuleElasticsearchConfig.java b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/StorageModuleElasticsearchConfig.java
new file mode 100644
index 000000000..92768ad20
--- /dev/null
+++ b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/StorageModuleElasticsearchConfig.java
@@ -0,0 +1,136 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.storage.plugin.elasticsearch;
+
+import org.apache.skywalking.oap.server.library.module.ModuleConfig;
+
+/**
+ * @author peng-yongsheng
+ */
+public class StorageModuleElasticsearchConfig extends ModuleConfig {
+
+    private int indexShardsNumber;
+    private int indexReplicasNumber;
+    private boolean highPerformanceMode;
+    private int traceDataTTL = 90;
+    private int minuteMetricDataTTL = 90;
+    private int hourMetricDataTTL = 36;
+    private int dayMetricDataTTL = 45;
+    private int monthMetricDataTTL = 18;
+    private int bulkActions = 2000;
+    private int bulkSize = 20;
+    private int flushInterval = 10;
+    private int concurrentRequests = 2;
+
+    int getIndexShardsNumber() {
+        return indexShardsNumber;
+    }
+
+    void setIndexShardsNumber(int indexShardsNumber) {
+        this.indexShardsNumber = indexShardsNumber;
+    }
+
+    int getIndexReplicasNumber() {
+        return indexReplicasNumber;
+    }
+
+    void setIndexReplicasNumber(int indexReplicasNumber) {
+        this.indexReplicasNumber = indexReplicasNumber;
+    }
+
+    boolean isHighPerformanceMode() {
+        return highPerformanceMode;
+    }
+
+    void setHighPerformanceMode(boolean highPerformanceMode) {
+        this.highPerformanceMode = highPerformanceMode;
+    }
+
+    public int getTraceDataTTL() {
+        return traceDataTTL;
+    }
+
+    void setTraceDataTTL(int traceDataTTL) {
+        this.traceDataTTL = traceDataTTL == 0 ? 90 : traceDataTTL;
+    }
+
+    public int getMinuteMetricDataTTL() {
+        return minuteMetricDataTTL;
+    }
+
+    void setMinuteMetricDataTTL(int minuteMetricDataTTL) {
+        this.minuteMetricDataTTL = minuteMetricDataTTL == 0 ? 90 : minuteMetricDataTTL;
+    }
+
+    public int getHourMetricDataTTL() {
+        return hourMetricDataTTL;
+    }
+
+    void setHourMetricDataTTL(int hourMetricDataTTL) {
+        this.hourMetricDataTTL = hourMetricDataTTL == 0 ? 36 : hourMetricDataTTL;
+    }
+
+    public int getDayMetricDataTTL() {
+        return dayMetricDataTTL;
+    }
+
+    void setDayMetricDataTTL(int dayMetricDataTTL) {
+        this.dayMetricDataTTL = dayMetricDataTTL == 0 ? 45 : dayMetricDataTTL;
+    }
+
+    public int getMonthMetricDataTTL() {
+        return monthMetricDataTTL;
+    }
+
+    void setMonthMetricDataTTL(int monthMetricDataTTL) {
+        this.monthMetricDataTTL = monthMetricDataTTL == 0 ? 18 : monthMetricDataTTL;
+    }
+
+    public int getBulkActions() {
+        return bulkActions;
+    }
+
+    public void setBulkActions(int bulkActions) {
+        this.bulkActions = bulkActions == 0 ? 2000 : bulkActions;
+    }
+
+    public int getBulkSize() {
+        return bulkSize;
+    }
+
+    public void setBulkSize(int bulkSize) {
+        this.bulkSize = bulkSize == 0 ? 20 : bulkSize;
+    }
+
+    public int getFlushInterval() {
+        return flushInterval;
+    }
+
+    public void setFlushInterval(int flushInterval) {
+        this.flushInterval = flushInterval == 0 ? 10 : flushInterval;
+    }
+
+    public int getConcurrentRequests() {
+        return concurrentRequests;
+    }
+
+    public void setConcurrentRequests(int concurrentRequests) {
+        this.concurrentRequests = concurrentRequests == 0 ? 2 : concurrentRequests;
+    }
+}
diff --git a/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/StorageModuleElasticsearchProvider.java b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/StorageModuleElasticsearchProvider.java
new file mode 100644
index 000000000..2a7a87555
--- /dev/null
+++ b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/StorageModuleElasticsearchProvider.java
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.skywalking.oap.server.storage.plugin.elasticsearch;
+
+import org.apache.skywalking.oap.server.core.storage.StorageModule;
+import org.apache.skywalking.oap.server.library.module.*;
+import org.slf4j.*;
+
+/**
+ * @author peng-yongsheng
+ */
+public class StorageModuleElasticsearchProvider extends ModuleProvider {
+
+    private static final Logger logger = LoggerFactory.getLogger(StorageModuleElasticsearchProvider.class);
+
+    private final StorageModuleElasticsearchConfig storageConfig;
+
+    public StorageModuleElasticsearchProvider() {
+        super();
+        this.storageConfig = new StorageModuleElasticsearchConfig();
+    }
+
+    @Override public String name() {
+        return "elasticsearch";
+    }
+
+    @Override public Class module() {
+        return StorageModule.class;
+    }
+
+    @Override public ModuleConfig createConfigBeanIfAbsent() {
+        return storageConfig;
+    }
+
+    @Override public void prepare() throws ServiceNotProvidedException {
+    }
+
+    @Override public void start() throws ModuleStartException {
+    }
+
+    @Override public void notifyAfterCompleted() {
+    }
+}
diff --git a/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/resources/META-INF/services/org.apache.skywalking.oap.server.library.module.ModuleProvider b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/resources/META-INF/services/org.apache.skywalking.oap.server.library.module.ModuleProvider
new file mode 100644
index 000000000..3bafa18fd
--- /dev/null
+++ b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/resources/META-INF/services/org.apache.skywalking.oap.server.library.module.ModuleProvider
@@ -0,0 +1,19 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You 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.
+#
+#
+
+org.apache.skywalking.oap.server.storage.plugin.elasticsearch.StorageModuleElasticsearchProvider
\ No newline at end of file
diff --git a/oap-server/server-core/core-cluster/pom.xml b/oap-server/server-storage-plugin/storage-h2-plugin/pom.xml
similarity index 91%
rename from oap-server/server-core/core-cluster/pom.xml
rename to oap-server/server-storage-plugin/storage-h2-plugin/pom.xml
index c41d739f8..2cb644e48 100644
--- a/oap-server/server-core/core-cluster/pom.xml
+++ b/oap-server/server-storage-plugin/storage-h2-plugin/pom.xml
@@ -21,13 +21,13 @@
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <parent>
+        <artifactId>server-storage-plugin</artifactId>
         <groupId>org.apache.skywalking</groupId>
-        <artifactId>server-core</artifactId>
         <version>6.0.0-alpha-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 
-    <artifactId>core-cluster</artifactId>
+    <artifactId>storage-h2-plugin</artifactId>
     <packaging>jar</packaging>
 
 </project>
\ No newline at end of file


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services