doc: add introducing-ent blog post

Reviewed By: alexsn

Differential Revision: D17717270

fbshipit-source-id: e566d256a034a9579a05d0975de133f4ccf5ad6d
This commit is contained in:
Ariel Mashraki
2019-10-02 12:54:06 -07:00
committed by Facebook Github Bot
parent 1ebfa489c5
commit 37898ff5c8
4 changed files with 79 additions and 3 deletions

View File

@@ -23,5 +23,11 @@ The documentation for developing and using ent is avaliable at: https://entgo.io
## Join the ent Community
See the [CONTRIBUTING](CONTRIBUTING.md) file for how to help out.
## Project Status
`ent` was developed and maintained by [a8m](https://github.com/a8m) and [alexsn](https://github.com/alexsn)
from the Facebook Connectivity team. It's currently considered experimental (although we're using it in production),
and the roadmap for v1 release is described [here](https://github.com/facebookincubator/ent/issues/46).
Read more about the motivation of the project [here](https://entgo.io/blog/2019/10/03/introducing-ent).
## License
ent is licensed under Apache 2.0 as found in the LICENSE file.

View File

@@ -0,0 +1,50 @@
---
title: Introducing ent
author: Ariel Mashraki
authorURL: https://github.com/a8m
authorImageURL: https://avatars0.githubusercontent.com/u/7413593
authorTwitter: arielmashraki
---
## The state of Go in Facebook Connectivity Tel Aviv
20 months ago, I joined Facebook Connectivity (FBC) team in Tel Aviv after ~5 years
of programming in Go and embedding it in a few companies.
I joined a team that was working on a new project and we needed to choose a language
for this mission. We compared a few languages and decided to go with Go.
Since then, Go continued to spread across other FBC projects and became a big success
with around 15 Go engineers in Tel Aviv alone. **New services are now written in Go**.
## The motivation for writing a new ORM in Go
Most of my work in my 5 years before Facebook was on infra tooling and micro-services without
too much data-model work. A service that was needed to do a little amount of work with an SQL
database used one of the existing open-source solutions, but one that had worked with a
complicated data model was written in a different language with a robust ORM. For example,
Python with SQLAlchemy.
At Facebook we like to think about our data-model in graph concepts. We've had a good experience
with this model internally.
The lack of a proper Graph-based ORM for Go, led us to write one here with the following principles:
- **Schema As Code** - defining types, relations and constraints should be in Go code (not struct
tags), and should be validated using a CLI tool. We have good experience with a similar tools
internally at Facebook.
- **Statically typed and explicit API** using codegen - API with `interface{}`s everywhere effects
developers efficiency; especially project newbies.
- **Queries, aggregations and graph traversals** should be simple - developers dont want to deal
with raw SQL queries nor SQL terms.
- **Predicates should be statically typed**. No strings everywhere.
- Full support for `context.Context` - This helps us to get full visibility in our traces and logs
systems, and its important for other features like cancellation.
- **Storage agnostic** - we tried to keep the storage layer dynamic using codegen templates,
since the development initially started on Gremlin (AWS Neptune) and switched later to MySQL.
## Open-sourcing ent
**ent** is an entity framework (ORM) for Go, built with the principles described above.
**ent** makes it possible to define any data model or graph-structure in Go code easily; The
schema configuration is verified by **entc** (the ent codegen) that generates an idiomatic and
statically-typed API that keeps Go developers productive and happy.
It supports MySQL, SQLite (mainly for testing) and Gremlin. PostgreSQL will be added soon.
Were open-sourcing **ent** today, and invite you to get started → [entgo.io/docs/getting-started](/docs/getting-started).

View File

@@ -39,6 +39,7 @@ const siteConfig = {
{doc: 'getting-started', label: 'Docs'},
{href: 'https://godoc.org/github.com/facebookincubator/ent', label: 'GoDoc'},
{href: 'https://github.com/facebookincubator/ent', label: 'Github'},
{ blog: true, label: 'Blog' },
],
// If you have users set above, you add it here:

View File

@@ -131,6 +131,10 @@ body {
background: #3d3e3f;
}
body.blog {
background: white;
}
.sideNavVisible {
background: white;
}
@@ -139,16 +143,22 @@ body {
background: #3d3e3f;
}
.blog .fixedHeaderContainer,
.sideNavVisible .fixedHeaderContainer {
background: white;
max-width: 1400px;
margin: 0 auto;
}
.blog .wrapper {
max-width: 1400px;
}
.sideNavVisible.navigationSlider .slidingNav ul {
background: white;
}
.blog .slidingNav ul li a,
.sideNavVisible .navigationSlider .slidingNav ul li a {
color: #3d3e3f !important;
}
@@ -404,6 +414,7 @@ a {
overflow-x: hidden;
}
.blog .fixedHeaderContainer,
.sideNavVisible.separateOnPageNav .fixedHeaderContainer {
width: 100vw;
}
@@ -466,18 +477,22 @@ header > .navigationSlider {
/*
Docs Page
*/
.blog > .navigationSlider,
.sideNavVisible header > .navigationSlider {
margin-left: 0;
}
.blog > .fixedHeaderContainer a,
.sideNavVisible .fixedHeaderContainer a {
display: flex !important;
}
.blog .navigationSlider .slidingNav,
.sideNavVisible .navigationSlider .slidingNav {
position: relative;
}
.blog .fixedHeaderContainer,
.sideNavVisible .fixedHeaderContainer {
display: flex;
align-items: center;
@@ -485,6 +500,7 @@ header > .navigationSlider {
padding: 0;
}
.blog .navigationWrapper.navigationSlider,
.sideNavVisible .navigationWrapper.navigationSlider {
align-self: flex-end;
align-items: center;
@@ -497,26 +513,27 @@ header > .navigationSlider {
}
}
.blog .headerWrapper.wrapper,
.sideNavVisible .headerWrapper.wrapper {
width: 100vw;
margin: 0 20px;
}
.blog .headerWrapper.wrapper header,
.sideNavVisible .headerWrapper.wrapper header {
width: 100vw;
}
.blog .headerWrapper.wrapper header > a,
.sideNavVisible .headerWrapper.wrapper header > a {
width: 288px;
}
.sideNavVisible .headerWrapper.wrapper header a {
}
.navigationSlider .slidingNav ul {
background: transparent;
}
.blog .navigationSlider .slidingNav ul,
.sideNavVisible .navigationSlider .slidingNav ul {
background: white;
margin-top: 0;
@@ -542,12 +559,14 @@ ol {
}
@media only screen and (min-width: 1000px) {
.blog .fixedHeaderContainer,
.sideNavVisible.separateOnPageNav .fixedHeaderContainer {
margin-top: 35px;
width: 100vw;
}
}
.blog .slidingNav ul li a,
.sideNavVisible .navigationSlider .slidingNav ul li a {
font-family: 'Calibre Light', sans-serif;
}