I'm Ayushi, based in Toronto, and a recent graduate from the University of Waterloo! This summer, I'm excited to be working on Swift-etcd: A Native Client for Seamless Integration with etcd Servers as a GSoC contributor, alongside my mentor @FranzBusch. Our mission is to develop a native Swift-etcd client that seamlessly integrates etcd, a distributed key-value store, into Swift applications.
Our primary objective is to harness the power of grpc-swift to facilitate authentication, key-value operations, watch operations, and lease management, ensuring a seamless and efficient communication channel between Swift services and etcd servers.
I'd like to kick off a thread to update the community on my progress, provide regular updates and to get feedback and insights from all of you!
I wanted to share an update for the GSoC project - Swift ETCD Client. I have implemented the core functions for interacting with etcd: get, set, put, and delete. These functions allow Swift developers to interact with etcd via a Swift API.
Get: Retrieves the value of a specified key from the etcd store.
Set: Updates the value of an existing key or creates a new key-value pair if it doesn't exist.
Put: Similar to set, but designed for batch operations to enhance performance.
Delete: Removes a specified key and its associated value from the store.
I am now focusing on implementing the watch operation. This feature will enable real-time monitoring of changes to specific keys within the etcd store. Through the watch operation, applications can react dynamically to changes.
Below, is a code snippet outlining how the get/set/put/delete functions work.
import NIO
let etcdClient = EtcdClient(host: "localhost", port: 2379, eventLoopGroup: .singleton)
try await etcdClient.set("foo", value: "bar")
var value = try await etcdClient.get("foo")
print("Value after set: \(value)")
try await etcdClient.put("foo", value: "baz")
value = try await etcdClient.get("foo")
print("Value after put: \(value)")
try await etcdClient.delete("foo")
print("Key 'foo' deleted")
I'm Ayushi, a recent graduate from the University of Waterloo, currently based in Vancouver. This summer, I had the privilege of participating in Google Summer of Code (GSoC) as a contributor under the Swift organization. I worked closely with Franz Busch to develop a native Swift ETCD client, which you can check out here.
The primary goal of this project was to provide Swift developers with an asynchronous-first Swift API for interacting with ETCD. We started by implementing core functionalities like get, set, put, and delete:
Get: Retrieves the value of a specified key from the ETCD store.
Set: Updates the value of an existing key or creates a new key-value pair if it doesn’t exist.
Put: Similar to set, but optimized for batch operations to enhance performance.
Delete: Removes a specified key and its associated value from the store.
After completing the core functions, I focused on implementing a watch function, which allows developers to monitor changes to an ETCD key and trigger a callback when the value changes. I also updated the get and put functions to allow for range queries, instead of a single key, allowing for multiple keys to be queried simultaneously. With these changes, the swift etcd-client now provides developers with an even powerful tool for building responsive and dynamic applications.
Future Work:
To continue providing Swift developers with a seamless way to interact with etcd natively, lease operations would be the next piece of development. Lease operations attach a lease to a key and bound a keys’ lifetime to the lease’s lifetime via a time-to-live. When the lease expires, all keys associated with the lease are deleted.
Throughout these three months, I’ve gained invaluable experience working with Swift server-side technologies and contributing to open-source projects. I’m eager to continue contributing to this project in the future. I’d like to extend my heartfelt thanks to Franz and the entire Swift community for their guidance and support throughout this journey.
Hey there @ayushi2103
It was nice to read about your journey.
I am learning swift and iOS app Dev rn and want to apply to gsoc next year...
The project ideas which were presented last year are new to me and want to know how to proceed to be able to understand them deeply...
I would like to ask what did you learn before applying and how did you chose relavent problem statement.