{"id":13417913,"url":"https://github.com/facebook/fbthrift","last_synced_at":"2025-05-13T17:12:11.303Z","repository":{"id":9295409,"uuid":"11131631","full_name":"facebook/fbthrift","owner":"facebook","description":"Facebook's branch of Apache Thrift, including a new C++ server.","archived":false,"fork":false,"pushed_at":"2025-05-08T02:25:54.000Z","size":237703,"stargazers_count":2613,"open_issues_count":39,"forks_count":613,"subscribers_count":185,"default_branch":"main","last_synced_at":"2025-05-08T03:29:43.634Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/facebook.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2013-07-02T18:15:51.000Z","updated_at":"2025-05-08T02:25:59.000Z","dependencies_parsed_at":"2023-09-21T18:38:35.204Z","dependency_job_id":"ffd18e99-83ff-465a-8928-724985ccc44f","html_url":"https://github.com/facebook/fbthrift","commit_stats":{"total_commits":26382,"total_committers":1448,"mean_commits":18.21961325966851,"dds":0.7735577287544538,"last_synced_commit":"ee6e7a0b2d0d7bacdc19db48ad46f84ab405168c"},"previous_names":[],"tags_count":440,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/facebook%2Ffbthrift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/facebook%2Ffbthrift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/facebook%2Ffbthrift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/facebook%2Ffbthrift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/facebook","download_url":"https://codeload.github.com/facebook/fbthrift/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253990483,"owners_count":21995775,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T22:00:55.324Z","updated_at":"2025-05-13T17:12:06.289Z","avatar_url":"https://github.com/facebook.png","language":"C++","readme":"Facebook Thrift\n---------------\n\n[![Support Ukraine](https://img.shields.io/badge/Support-Ukraine-FFD500?style=flat\u0026labelColor=005BBB)](https://opensource.fb.com/support-ukraine)\n[![Linux Build Status](\n  https://github.com/facebook/fbthrift/actions/workflows/getdeps_linux.yml/badge.svg)](\n  https://github.com/facebook/fbthrift/actions/workflows/getdeps_linux.yml)\n[![macOS Build Status](\n  https://github.com/facebook/fbthrift/actions/workflows/getdeps_mac.yml/badge.svg)](\n  https://github.com/facebook/fbthrift/actions/workflows/getdeps_mac.yml)\n[![Windows Build Status](\n  https://github.com/facebook/fbthrift/actions/workflows/getdeps_windows.yml/badge.svg)](\n  https://github.com/facebook/fbthrift/actions/workflows/getdeps_windows.yml)\n\u003cimg src=\"thrift/website/static/img/logo.svg\"\n     alt=\"Facebook Thrift Logo\" align=\"right\" width=\"20%\"/\u003e\n\nThrift is a serialization and RPC framework for service communication. Thrift enables these features in all major languages, and there is strong support for C++, Python, Hack, and Java. Most services at Facebook are written using Thrift for RPC, and some storage systems use Thrift for serializing records on disk.\n\nFacebook Thrift is not a distribution of [Apache Thrift](https://thrift.apache.org/). This is an evolved internal branch of Thrift that Facebook re-released to the open source community in February 2014. Facebook Thrift was originally released closely tracking Apache Thrift but is now evolving in new directions. In particular, the compiler was rewritten from scratch and the new implementation features a fully asynchronous Thrift server. Read more about these improvements in the [ThriftServer documentation](https://github.com/facebook/fbthrift/blob/main/thrift/doc/languages/cpp/cpp2.md).\n\nYou can also learn more about this project in the original Facebook Code [blog post](https://code.facebook.com/posts/1468950976659943/under-the-hood-building-and-open-sourcing-fbthrift/).\n\nTable of Contents\n=========================\n\n* [About Thrift](#about-thrift)\n  * [A Code Generator](#a-code-generator)\n  * [A Serialization Framework](#a-serialization-framework)\n  * [An RPC Framework](#an-rpc-framework)\n* [Building](#building)\n  * [Dependencies](#dependencies)\n  * [Build](#build)\n  * [Thrift Files](#thrift-files)\n* [C++ Static Reflection](#c-static-reflection)\n* [C++ Server Metrics](#c-server-metrics)\n\n## About Thrift\nAt a high level, Thrift is three major things:\n\n### A Code Generator\n\nThrift has a code generator which generates data structures that can be serialized using Thrift, and client and server stubs for RPC, in different languages.\n\n### A Serialization Framework\n\nThrift has a set of protocols for serialization that may be used in different languages to serialize the generated structures created from the code generator.\n\n### An RPC Framework\n\nThrift has a framework to frame messages to send between clients and servers and to call application-defined functions when receiving messages in different languages.\n\nThere are several key goals for these components:\n* Ease of use:\n  Thrift takes care of the boilerplate of serialization and RPC and enables the developer to focus on the schema of the system's serializable types and on the interfaces of the system's RPC services.\n\n* Cross-language support:\n  Thrift enables intercommunication between different languages. For example, a Python client communicating with a C++ server.\n\n* Performance:\n  Thrift structures and services enable fast serialization and deserialization, and its RPC protocol and frameworks are designed with performance as a feature.\n\n* Backwards compatibility:\n  Thrift allows fields to be added to and removed from serializable types in a manner that preserves backward and forward compatibility.\n\n## Building\n\n### Dependencies\n\nOn Linux or MacOS (with [Homebrew](https://brew.sh/) installed) you can install\nsystem dependencies to avoid building them:\n\n    # Clone the repo\n    git clone https://github.com/facebook/fbthrift\n    # Install dependencies\n    cd fbthrift\n    ./build/fbcode_builder/getdeps.py install-system-deps --recursive fbthrift\n\nOn other platforms or if on Linux and without system dependencies `getdeps.py`\nwill mostly download and build them for you during the build step.\n\nSome of the dependencies `getdeps.py` uses and installs are:\n\n**System**:\n[Boost](https://www.boost.org),\n[CMake](https://cmake.org),\n[OpenSSLv1.0.2g](https://www.openssl.org),\n[PThreads](https://computing.llnl.gov/tutorials/pthreads),\n[Python](https://www.python.org/), and\n[Zlib](https://zlib.net)\n\n**External**:\n[{fmt}](https://github.com/fmtlib/fmt),\n[GFlags](https://github.com/gflags/gflags),\n[GLog](https://github.com/google/glog), and\n[GTest and GMock](https://github.com/google/googletest)\n\n**Facebook**:\n[Fizz](https://github.com/facebookincubator/fizz),\n[Folly](https://github.com/facebook/folly),\n[Wangle](https://github.com/facebook/wangle), and\n[Zstd](https://github.com/facebook/zstd)\n\nThe Thrift compiler only depends on Boost, CMake and {fmt}.\n\n### Build\n\n    # Clone the repo\n    git clone https://github.com/facebook/fbthrift\n    cd fbthrift\n    # Build, using system dependencies if available\n    ./build/fbcode_builder/getdeps.py --allow-system-packages build fbthrift\n\n`getdeps.py` will invoke cmake etc and put output in its scratch area (you can see in logs, and can override with `--scratch-path`):\n\n* `installed/fbthrift/bin/thrift1`: The Thrift compiler binary to generate client and\n  server code.\n* `installed/fbthrift/lib/libthriftcpp2.a`: Library for clients and servers.\n\nIf you want to invoke `cmake` again to iterate, there is a helpful `run_cmake.py` output in the scratch `build/fbthrift` directory.\n\nCMake options:\n\n* `THRIFT_COMPILER_ONLY`:\n  specifies whether to build only the Thrift compiler (OFF by default)\n* `enable_tests`:\n  specifies whether to enable tests\n\n### Thrift Files\n\nWhen using thrift and the CMake build system, include: `ThriftLibrary.cmake` in\nyour project. This includes the following macro to help building Thrift files:\n\n    thrift_library(\n      #file_name\n      #services\n      #language\n      #options\n      #file_path\n      #output_path\n    )\n\nThis generates a library called `file_name-\u003clanguage\u003e`. That is, for\n`Test.thrift` compiled as cpp2, it will generate the library `Test-cpp2`.\nThis should be added as a dependency to any source or header file that contains\nan include to generated code.\n\n## C++ Static Reflection\n\nInformation regarding C++ Static Reflection support can be found under the [static reflection library directory](thrift/lib/cpp2/reflection/), in the corresponding [`README` file](thrift/lib/cpp2/reflection/README.md).\n\n## C++ Server Metrics\n\nTo collect runtime stats from a Thrift server, e.g. the number of active requests/connections, the C++ Thrift server supports an observer API that installs callbacks at a set of specific execution points in the server.\n\nTo expose collected metrics out of the server process, one way is to use `fb303` interfaces, see [fb303 Github repo](https://github.com/facebook/fb303).\n\n## License\n\nFacebook Thrift is [Apache 2.0 licensed](LICENSE).\n","funding_links":[],"categories":["TODO scan for Android support in followings","Serialization","C++"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffacebook%2Ffbthrift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffacebook%2Ffbthrift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffacebook%2Ffbthrift/lists"}