RepoPilot

How do their APIs compare?

About realm/realm-java · 2 messages · last activity 9/6/2026

Question

How do their APIs compare?

RepoPilot

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, @throws requirements) 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 underlying in() query method on RealmQuery [realm/kotlin-extensions/src/main/kotlin/io/realm/kotlin/RealmQueryExtensions.kt:L1-L40].
  • Schema/model shaping is handled through annotations (@RealmField, @RealmClass, naming policies like RealmNamingPolicy.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/@PutMapping methods 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: PermissionCommonApi exposes hasAnyPermissions, hasAnyRoles, and getDeptDataPermission as 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].
  • OAuth2TokenCommonApi defines 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 HttpUtils handles 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-java

Public 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.