Introducing the Geode Native Client by Blake Bender and Charlie Black from Pivotal. The summary provides an overview of the Geode Native Client including its features, use cases, and code examples:
The document introduces the Geode Native Client, which provides the same features as the Java Client in C++, C#, and soon NodeJS, including connection pooling, data access, events, transactions, and accessing multiple systems in a process. Example use cases include rich desktop applications, backing services, and enterprise integration. The document provides code examples for connecting to Geode, creating regions, putting and getting values, and querying.
3. Agenda
● Background on Geode Native Client
● Features
● Use Cases
● Pivotal steeltoe
● Coding Examples
● Q&A
We are available after the talk!
3
4. Some History
4
● Before Pivotal donated the code we modernized it to C++11
● Dec 2018 First Official Geode Native Client Release - Geode
1.8.0
● Oct 2019 First Summit Appearance!!!
● If you want to be a code committer:
○ Interesting: C++ code base was going to be server
5. Features at a Glance
5
Same awesome feature set as the Java Client presented in
C++, C# and soon to be NodeJS
● Connection Pooling
● Data Aware for Single Hop Data Access
● Events - ALL, Key Based, and “Where” Predicate
● Durable Client Subscriptions
● Function - Execute your business logic next to data
● Transactions
● … Wait for it …
8. Use Case
● Rich Desktop Application
● Backing Service to a 12 Factor App
● Enterprise Integration Patterns
● …
8
9. Use Case
● Anywhere this Icon appears in a Architecture
● Sometimes this Icon
9
Database
Queue
10. Steeltoe
● Steeltoe provides simpler ways to
build cloud-native .NET microservices.
● Steeltoe Connectors simplify the
process of connecting and using
services on Cloud Foundry.
● Geode Steeltoe Connector is in 2.3.0
10
Service Connectors for
11. What would I have to do?
…"locators": [
"locator1[55221],locator2[55221]"
],
"users": [
{
"password": ”******",
"roles": [
"developer"
],
"username":
"developer_IGSCs4jepdKTUypXkhmA"
}
],…
11
Service Connectors for
14. Geode Native Prerequisites for .net
● Windows 10-based OS - Windows 2016 server, Windows 10 desktop
● Visual Studio 2015 (we build/test with Community Edition)
● Geode Native library (build from sources)
14
15. Items you’ll collect along the way
● A Cache - create from a CacheFactory
● A Pool - create from a PoolFactory, obtained from Cache
● A Region - create from RegionFactory, obtained from Cache, OR get via
Cache.GetRegion() if it already exists
15
16. Creating a Cache
...
using System;
using Apache.Geode.Client;
...
var cacheFactory = new CacheFactory()
.Set("log-level", "none");
var cache = cacheFactory.Create();
...
16
17. Creating a Pool
...
var poolFactory = cache.GetPoolFactory()
.AddLocator("localhost", 10334);
poolFactory.Create("pool");
…
17
18. Creating a Region
...
var regionFactory = cache.CreateRegionFactory(RegionShortcut.PROXY)
.SetPoolName("pool");
var region = regionFactory.Create<string, string>("example_userinfo");
…
18
20. About Those Values...
● Values in a Geode cache can be a wide variety of things -
various numeric types, strings, arrays, PDX or DataSerializable
objects, etc.
● Keys can also be almost anything you like.
● Choose wisely!
20
21. Issuing a Query
…
Console.WriteLine("Getting the orders from the region");
var query = queryService.NewQuery<Order>("SELECT * FROM /custom_orders WHERE
quantity > 30");
var queryResults = query.Execute();
Console.WriteLine("The following orders have a quantity greater than 30:");
foreach (Order value in queryResults)
{
Console.WriteLine(value.ToString());
}
…
21
22. Advanced(ish) Usage
● Multiple Regions
● Custom objects for values (or keys)
● Function execution
● ContinuousQuery
● CacheListener
● PersistenceManager
● Security
22