Code Monkey home page Code Monkey logo

fae's Introduction

fae - Fun App Engine

Distributed middleware layer of multilingual RPC engine for enterprise SOA infrastructure.

     ____      __      ____ 
    ( ___)    /__\    ( ___)
     )__)    /(__)\    )__) 
    (__)    (__)(__)  (____)

Build Status

Architecture

    +----------------+  +----------------+  +----------------+
    | php-fpm worker |  | php-fpm worker |  | php-fpm worker |
    +----------------+  +----------------+  +----------------+
        |                       |                       |
        +-----------------------------------------------+
                                |                        
                                | short lived tcp/unix socket                        
                                |                        
                                |                            peers discover
                                |                            +---------------+
                                |                     +------|  faed daemon  |-------+
                        +---------------+             |      +---------------+       |
                        |  faed daemon  |  tcp        |                              |
                        +---------------+ ------------|      peers discover          |
                        |  LRU cache    |  proxy      |      +---------------+       |
                        +---------------+             +------|  faed daemon  |-------|
                                |                            +---------------+       |
                                |                                                    |
                                |                    consitent hash with replicas    |
                                |----------------------------------------------------+
                                |
                                | tcp long connection pool(heartbeat) with recycling
                                |
        +-----------------------------------------------+
        |                       |                       |     self contained
    +----------------+  +----------------+  +------------------------------+
    | mongodb servers|  |memcache servers|  | lcache | kvdb | idgen | ...  |
    +----------------+  +----------------+  +------------------------------+

Why SOA?

  • More clear architecture
  • Seperation of concerns
  • Reuse common code as service and transparently reuse infrastructure
  • Centralized best practice
  • Centralized monitoring, auditting and profiling
  • Independently deployable/testable
    • vital code should be more robust
    • can't have too much vital code
  • Reduce tcp 3/4 way handshake overhead
  • Horizontal scale made easy
    • frontend(php) and middleware scale independently
    • middleware is in charge of performance while frontend is in charge of biz logic
  • Polyglot development

Terms

  • Engine
  • Servant
  • Peer

Highlights

  • Self manageable cluster
  • Dynamic cluster reconfiguration
    • VBucket
      • Better than consistent hashing
        • because they are easier to move between servers then individual keys
      • Never service a request on the wrong server
        • compared with consitent hash
      • Allow scaling up and down at will
      • We can hand data sets from one server another atomically
      • Servers still do not know about each other
  • Easy extending for more servants(RPC service)
  • Highly usage of mem to improve latancy & throughput
  • Circuit breaker protection
  • Full realtime internal stats export via http
  • Smart metrics with low overhead
  • Easy graceful degrade for OPS
    • auto
    • manual

TODO

  • optimize mysql query, iterate each row to transform to string/null
  • start fae, then restart remote peer, then call ServantByKey, see what happens
  • session.profiler should not be pointer, reduce GC overhead
  • bloom filter
  • unified err logging so that external alarming system can get notified
  • use of closed network connection
  • more strict test on zookeeper failure
  • mysql prepare stmt caching
  • vBucket for cluster sharding, what about each kingdom is a shard?
  • hot reload config
  • fae graceful shutdown
  • maybe profiler sample rate is totally controlled by client
  • zk connection loss and session expiration
  • NewTBufferedTransportFactory buffer size, and php config buf size
  • golang uses /proc/sys/net/core/somaxconn as listener backlog
    • increase it if you need over 128(default) simultaneous outstanding connections

Contribs

fae's People

Contributors

funkygao avatar

Watchers

James Cloos avatar nicholaskh avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.