EdgeDB in Depth (eBook)
250 Seiten
HiTeX Press (Verlag)
978-0-00-102468-7 (ISBN)
'EdgeDB in Depth'
'EdgeDB in Depth' offers a comprehensive exploration of EdgeDB, the innovative object-relational database reshaping how developers model, query, and manage data. This authoritative guide provides readers with a solid foundation, tracing EdgeDB's evolution from traditional relational databases and detailing its architecture, core concepts, and place within today's data ecosystem. Through practical comparisons with PostgreSQL and graph databases, as well as an honest discussion of design trade-offs and limitations, the book equips readers with the context needed to make informed architectural decisions.
Delving deeper, the book delivers hands-on instruction in data modeling, schema design, and the use of EdgeQL, EdgeDB's powerful query language. Readers learn advanced relationship modeling, declarative schema techniques, and best practices for managing schema evolution, versioning, and migrations. The in-depth coverage extends to application integration through official drivers, code generation, dynamic type systems, and integration with popular frameworks such as FastAPI, Django, and Next.js. Comprehensive chapters on performance engineering, security, compliance, deployment automation, and high availability address the needs of teams operating at scale.
Finally, 'EdgeDB in Depth' ventures into distributed systems, cloud-native deployments, and advanced use cases including microservices, machine learning, and event-driven architectures. It surveys the growing EdgeDB tooling ecosystem, showcases real-world case studies, and highlights governance and community contributions. With an outlook toward future developments and open research areas, this book is an indispensable resource for engineers, architects, and technology leaders seeking to master EdgeDB and harness its full potential for modern application development.
Chapter 2
Data Modeling and Schema Design in EdgeDB
What if data models could fluently mirror the intricacies of your domain, unlocking both precision and flexibility? This chapter invites you to master EdgeDB’s declarative schema language and advanced modeling features, showing how to move beyond the constraints of legacy tables and relationships. Learn to architect expressive, robust, and scalable schemas that transform complexity into clarity-and set the foundation for highly maintainable software.
2.1 Declarative Schema Language
EdgeDB’s declarative schema language provides a rigorous yet expressive syntax for defining and manipulating data models, tightly integrating advanced type-theoretic principles to facilitate robustness, modularity, and developer productivity. It operates as the bedrock of the overall database system, enabling expressive type definitions, inheritance hierarchies, modular encapsulation, and powerful compositional patterns that collectively augment schema clarity and maintainability.
The schema language’s syntax is inspired by modern strongly typed languages but customized to address the needs of complex data modeling. Central to this language is the type keyword, used to declare object types that serve as first-class citizens in database schemas. Each type definition consists of a unique identifier, optional base types, and a block containing attribute and link declarations.
required property username -> str {
constraint exclusive;
}
optional property email -> str;
multi link groups -> Group;
}
In this snippet, the User type introduces scalar properties such as username and email, and a multi-link groups referencing the Group type. The constraint exclusive enforces uniqueness at the database level, showcasing how constraints integrate declaratively within the schema. Scalar types-ranging from primitives like int64, str, and bool to more complex constructs-are intrinsic to property declaration.
Inheritance in EdgeDB allows new types to extend existing ones, promoting reuse and polymorphism. It follows classical subtype rules augmented with strict structural compatibility to ensure safety. For example:
required property admin_level -> int64;
}
Here, Admin inherits all properties and links of User and introduces an additional property admin_level. The deep semantics of inheritance ensure that an Admin instance can be referenced anywhere a User is expected, enabling transparent substitutability. Furthermore, EdgeDB enforces that the child type can only strengthen constraints or add new attributes but cannot weaken inherited guarantees, preserving type soundness.
Modularization is supported through schema modules, which partition types and logic across namespaces. Modules encapsulate definitions, controlling their visibility and enabling separate schema compilation. This promotes maintainability and scalability in large projects, as modules can be imported selectively:
type User { ... }
type Session { ... }
}
using module auth;
type Profile {
required link owner -> auth::User;
}
The using module declaration transparently brings symbols from auth into scope. EdgeDB’s module system enforces clear boundaries while allowing compositional schema construction.
Compositional techniques extend beyond modularization to include reusable property blocks, abstract types, and parameterized types (generics). Abstract types, declared with the abstract keyword, define common interfaces or structural templates without direct instantiation:
required property manufacturer -> str;
...
| Erscheint lt. Verlag | 20.8.2025 |
|---|---|
| Sprache | englisch |
| Themenwelt | Mathematik / Informatik ► Informatik ► Programmiersprachen / -werkzeuge |
| ISBN-10 | 0-00-102468-X / 000102468X |
| ISBN-13 | 978-0-00-102468-7 / 9780001024687 |
| Informationen gemäß Produktsicherheitsverordnung (GPSR) | |
| Haben Sie eine Frage zum Produkt? |
Größe: 636 KB
Kopierschutz: Adobe-DRM
Adobe-DRM ist ein Kopierschutz, der das eBook vor Mißbrauch schützen soll. Dabei wird das eBook bereits beim Download auf Ihre persönliche Adobe-ID autorisiert. Lesen können Sie das eBook dann nur auf den Geräten, welche ebenfalls auf Ihre Adobe-ID registriert sind.
Details zum Adobe-DRM
Dateiformat: EPUB (Electronic Publication)
EPUB ist ein offener Standard für eBooks und eignet sich besonders zur Darstellung von Belletristik und Sachbüchern. Der Fließtext wird dynamisch an die Display- und Schriftgröße angepasst. Auch für mobile Lesegeräte ist EPUB daher gut geeignet.
Systemvoraussetzungen:
PC/Mac: Mit einem PC oder Mac können Sie dieses eBook lesen. Sie benötigen eine
eReader: Dieses eBook kann mit (fast) allen eBook-Readern gelesen werden. Mit dem amazon-Kindle ist es aber nicht kompatibel.
Smartphone/Tablet: Egal ob Apple oder Android, dieses eBook können Sie lesen. Sie benötigen eine
Geräteliste und zusätzliche Hinweise
Buying eBooks from abroad
For tax law reasons we can sell eBooks just within Germany and Switzerland. Regrettably we cannot fulfill eBook-orders from other countries.
aus dem Bereich