-
Notifications
You must be signed in to change notification settings - Fork 18
An important note on storage
One of the most important features of the playOrm library is flush which gives you a better chance of not corrupting your data in your nosql store. You will notice you can call EntityManager.put, put, put but it never writes to cassandra until you call flush. Also, as you call the put method, it is also queuing up index changes if needed as well. Once you call flush, it is all pushed to the nosql store.
All types are stored as their smallest type. A long of value 56 will be stored as only one byte. In fact any number of any integer type between -128 and 127 is stored as one byte. Same with decimal numbers. All are stored at their smallest value saving you lots of space. Column names still tend to take up a bit of space of course though I believe their compression helps a lot with this. We may in the future have a renaming mapper so all column names are very small of one or two digits only to take up less space.
Below the EntityManager, there is a NoSqlTypedSession which deals in BigDecimal, BigInteger and String only. It does not deal with any other types. It is the rawest interface you can use and unlike the ORM can deal with unknown schemas. You do need to define the unknown schema with the DboTableMeta and DboColumnXXXMeta and save those to their column families. This allows ad-hoc queries into unknown datasets that are not created with the ORM layers.
Use the static methods on StandardConverters.java to convert to byte[] format if you need to if you start using any of the raw apis.