For reads, writes, embedded SQL, any integration and any API, you can simply use TileDB Embedded with only two changes:
Every array registered with TileDB Cloud must be accessed using a URI of the form
<namespace> is the user or organization who owns the array and
<array-name> is the array name set by the owner upon array registration. This URI is displayed on the console when viewing the array details.
Here are some Python examples, although the above changes will work with any TileDB API or integration:
import tiledb, tiledb.sqlimport pandas# Create the configuration parametersconfig = tiledb.Config()config["rest.username"] = "xxx"config["rest.password"] = "yyy"# or, more preferably, config["rest.token"] = "ttt"# This is the array URI format in TileDB Cloudarray_name = "tiledb://TileDB-Inc/quickstart_sparse"# Write code exactly as in TileDB Developerwith tiledb.open(array_name, 'r', ctx=tiledb.Ctx(config)) as A:print (A.df[:])# Using embedded SQL, you need to pass the username/password or token# as config parameters in `init_command`db = tiledb.sql.connect(db="test",init_command="set mytile_tiledb_config='rest.username=xxx,rest.password=yyy'")pandas.read_sql(sql="select * from `tiledb://TileDB-Inc/quickstart_sparse`", con=db)
You can create an array inside or outside TileDB Cloud. The benefit of creating an array with TileDB Cloud is that it will be logged for auditing purposes. Moreover, it will be registered automatically with your account upon creation.
To instruct TileDB Embedded that you are creating an array through the TileDB Cloud service, you just need a single change:
Instead of using
<array-uri> as you would typically in TileDB Embedded, you must use
tiledb://<username>/<array-uri>. For example, if you wish to create an array at
s3://my_bucket/my_array, you need to set the array URI to