Extend storage

SkyWalking has already provided several storage solutions. In this document, you could learn how to easily implement a new storage.

Define your storage provider

  1. Define class extension org.apache.skywalking.oap.server.library.module.ModuleProvider.
  2. Set this provider targeting to storage module.
@Override 
public Class<? extends ModuleDefine> module() {
    return StorageModule.class;
}

Implement all DAOs

Here’s a list of all DAO interfaces in storage:

  1. IServiceInventoryCacheDAO

  2. IServiceInstanceInventoryCacheDAO

  3. IEndpointInventoryCacheDAO

  4. INetworkAddressInventoryCacheDAO

  5. IBatchDAO

  6. StorageDAO

  7. IRegisterLockDAO

  8. ITopologyQueryDAO

  9. IMetricsQueryDAO

  10. ITraceQueryDAO

  11. IMetadataQueryDAO

  12. IAggregationQueryDAO

  13. IAlarmQueryDAO

  14. IHistoryDeleteDAO

  15. IMetricsDAO

  16. IRecordDAO

  17. IRegisterDAO

  18. ILogQueryDAO

  19. ITopNRecordsQueryDAO

  20. IBrowserLogQueryDAO

  21. IProfileTaskQueryDAO

  22. IProfileTaskLogQueryDAO

  23. IProfileThreadSnapshotQueryDAO

  24. UITemplateManagementDAO

Register all service implementations

In public void prepare(), use this#registerServiceImplementation method to register and bind with your implementation of the above interfaces.

Example

org.apache.skywalking.oap.server.storage.plugin.elasticsearch.StorageModuleElasticsearchProvider and org.apache.skywalking.oap.server.storage.plugin.jdbc.mysql.MySQLStorageProvider are good examples.