Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Yuzhang Hu edited this page Apr 6, 2018 · 26 revisions

Introduction

Skull is a serving framework, it can start fast, has high development productivity and is easy to maintain.

Background

To start a new project, we usually need to read tons of documentations of the chosen framework/tech stack, then decide whether to use it and how to use it. It may take a week or more for a newbie, even for an expert, it sometimes still needs a batch of trivial efforts to build it from a scratch. It's really a terrible experience for us. Life is short, let's save the time on the most important things instead.

After we have a project, we will need to modify the code/configuration again and again, and do the test, sometimes we really want to switch to another language to solve a specific problem, but it's extremely hard to do that since we've already chosen a programing language for the project at the beginning. Have you ever regretted for the decision? For example, C/C++ provides high runtime performance, but the development cycle is very long, people should be really careful to deal with the low-level memory issues; On another hand, Python has rich packages to solve the problems, but the performance is much worse than C/C++, could we use them all in one program, to choose the right language in the right place, and the different language can communicate with each other very easily and smoothly?

Besides, it's hard for people to understand the complex program, especially when the code become more complex and huge, it's just like a big black box, and no one knows how it works, it would become un-maintainable since no one can see it clearly, even a basic workflow. Imagine that, how could a programmer figure out the basic workflow of a complex program without documentation in 5 minutes?

Under this situation, Skull was born to solve those kinds of problems. It's based on Google Protobuf and Flibs, target to Linux platform. Skull is consist of 3 components:

  • skull-engine
  • skull-api
  • skull-CLI

And, it provides the following key features for users who want to build a project easily:

  • Modular Development Environment
  • Project Management
  • Workflow Based
  • Lock-Free Environment
  • Native Monitoring
  • Native Async Network IO
  • Native Background IO Job
  • Native Timer
  • Multi-Languages Support (C/C++, Python)
  • Integrated with Nginx
  • Service Shareable
  • Basic Functional Test Environment provided

Key Concepts

There are also 3 major concepts in Skull: Workflow, Module and Service. Before using Skull, let's understand the core concepts first.

Module

Module is a independent logic set, it defines what kind of data/things we should use/do in this step.

skull concept module

Workflow

Workflow is more like a transaction rules, oriented automator or pipeline, it controls how the transaction works, execute the modules one by one until be finished. Multiple modules can be chosen to join in a workflow, and there also can be multiple workflows in Skull. Each Workflow has its own SharedData, every Module belongs to this Workflow can read/write it.

skull concept workflow

Service

Service is designed for managing the data, and provide a group of APIs to access the data. Module can use these APIs to access/consume the data, then decide what you want to do. Also the Service is shareable, it's highly recommended that user to share their Service to other skull projects, to make the world better.

skull concept service

Example of a Skull Application

skull high level

Performance

No one would care/adopt a program, if it has a bad system performance result, so let's see how the Skull performs.

  • Testing Environment
Role CPU Mem NIC
perf client 4 vcpus 2.3GHz 8GB 100 Mbps
skull-engine 8 vcpus 2.3GHz 16GB 1Gbps
  • Hard KPI
  • The response Latency must be lower than 50 milliseconds

Single Cpp Module

single cpp module

A Cpp Module Calling a Service

cpp module calling service

A Cpp Module Calling a Service(With EndPoint)

cpp module calling service with ep

Service Timer Job (Read)

service timer job read

Service Timer Job (Write)

service timer job write

Single Python Module

python module only

A Python Module Calling a Service

python module calling service

A Python Module Parsing Http Request

python module http parsing

Useful Links

Clone this wiki locally