How do their APIs compare?
How do their APIs compare?
About realm/realm-java · 2 messages · last activity 9/6/2026
These two projects operate at completely different layers of the stack, so "API" means something different in each case.
realm/realm-java: a mobile database SDK API
Realm Java's public API is a local, object-oriented database API embedded inside an Android app process. There's no network/HTTP surface for the core product — the "API" is the set of Java/Kotlin classes and methods developers call directly in-process (e.g. RealmQuery, RealmObject).
- It's query/persistence-oriented: methods like
equalTo(fieldName, fieldValue, caseSensitive)for building queries, documented with strict Javadoc conventions (verb-phrase descriptions,{@link}cross-references,@throwsrequirements) as shown in the contributing guidelines [CONTRIBUTING.md:L153-L196]. - Kotlin extension functions layer idiomatic sugar on top of the Java core API, e.g.
oneOf()which just delegates to the underlyingin()query method onRealmQuery[realm/kotlin-extensions/src/main/kotlin/io/realm/kotlin/RealmQueryExtensions.kt:L1-L40]. - Schema/model shaping is handled through annotations (
@RealmField,@RealmClass, naming policies likeRealmNamingPolicy.LOWER_CASE_WITH_UNDERSCORES/CAMEL_CASE/PASCAL_CASE) processed at compile time by an annotation processor rather than exposed as runtime REST/RPC endpoints [realm-annotations/src/main/java/io/realm/annotations/RealmNamingPolicy.java:L81-L120], [realm/realm-annotations-processor/src/main/java/io/realm/processor/Utils.kt:L556-L595]. - There is a narrow outbound HTTP call, but it's not a public API — it's an internal analytics beacon (
UrlEncodedAnalytics.execute) that GETs a MongoDB endpoint with base64-encoded usage data [realm-transformer/src/main/kotlin/io/realm/analytics/UrlEncodedAnalytics.kt:L26-L61].
So Realm Java's "API surface" is compile-time/in-process: Java/Kotlin method calls plus annotations, generating proxy classes rather than exposing network endpoints for consumers.
yunaiv/yudao-cloud: microservice HTTP/RPC APIs
yudao-cloud's APIs are Spring-based RESTful/RPC interfaces meant for cross-service and client communication in a microservices architecture.
- Interfaces are declared as Spring
@GetMapping/@PostMapping/@DeleteMapping/@PutMappingmethods on Java interfaces, annotated with Swagger/OpenAPI (@Operation,@Parameter(s)) for auto-generated docs — matching the README's stated feature of Swagger-based interface documentation [README.md:L204-L228]. - Example:
PermissionCommonApiexposeshasAnyPermissions,hasAnyRoles, andgetDeptDataPermissionas internal RPC-style endpoints prefixed with a system service path constant (RpcConstants.SYSTEM_PREFIX) [yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/biz/system/permission/PermissionCommonApi.java:L16-L43]. OAuth2TokenCommonApidefines a full token lifecycle API — create, check, remove, remove-by-user, refresh — again as HTTP endpoints consumed inter-service (explicitly noting the check endpoint is "provided for Gateway to use") [yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/biz/system/oauth2/OAuth2TokenCommonApi.java:L19-L62].- Responses are wrapped uniformly in
CommonResult<T>, a shared envelope type across all these interfaces, reflecting a consistent contract convention across services. - Supporting utility code like
HttpUtilshandles URL query manipulation (replaceUrlQuery,removeUrlQuery) used to build/rewrite these HTTP call targets, e.g. for OAuth2 redirect handling [yudao-framework/yudao-common/src/main/java/cn/iocoder/
Want to ask your own question?
Open chat for realm/realm-javaPublic Q&A. Generated by RepoPilot from the actual source of realm/realm-java. AI answers can be incomplete or stale — verify before relying on them.